|
error1408 wrote: I searched the documentation for my problem. And i found nothing.
You should probably provide that information in your initial post.
error1408 wrote: I checked every method.
I guess you missed this one[^]
|
|
|
|
|
THANK YOU. You're the man! Why didn't i see it before? At last the ugly code can be banished! Hurray
led mike wrote: You should probably provide that information in your initial post.
Yes perhaps
|
|
|
|
|
I wonder why Microsoft keeps hiding this information in the documentation?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Yeah and Google is culpable as well since they provide a perfectly usable Search Engine.
|
|
|
|
|
I'm trying to create ASPX page with DataGrid, that includes template column, which looks like TextBox. I order to enable data binding to textbox I'm using the following syntax:
<asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ID")%>' ID="txtID" /> using XSL.
I supposed, the XSL code should be the same, while escaping '<','>' etc.:
<asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ID")%>' ID="txtID" />.
In this case I'm getting the following error:
Parser Error Message: Code blocks are not supported in this page, because it is not compiled.
Please, assist.
Alex
-- modified at 10:06 Wednesday 29th August, 2007
|
|
|
|
|
It is objecting to the "<%# ... %>" code which gets placed in the .aspx page before it gets compiled. By the time you place your code in the page, the page has already been compiled. Also, why place a textbox in this way when you can do it statically in design mode?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Is there any workaround? Is it possible to implement this in code-behind file?
|
|
|
|
|
There are a some ways but you have to stay away from the code blocks. You may need to as your question in the ASP.NET Forum to get a better answer, but you can use XSL in the creation of a custom control or during the binding processs you can add content to a cell or even modify the whole row. However, you have to stay away from coding blocks.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Thanks anyway
|
|
|
|
|
how to create a xml document from a given xpath
Keshav Kamat
India
|
|
|
|
|
What do you mean? XPath is just a query. If you are talking about the resulting sequence or node set from an executed XPath query, what programming or mark-up language are you using?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I am trying to put a ":" inside the XML tags. e.g.
<cnn:data>
right now it is this way:
<cnn_x0020_data>
|
|
|
|
|
The ":" is used to add a namespace to an element, for example: <xsl:element/> , where xsl is the namespace. If you are not using ":" for this reason, it should not be embedded in an element.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I'm building a schema to define data transfer tasks, the first being an export to a flat file. I'm borrowing lightly from RDL, and in my DataExport element I have DataSources and DataSets elements. Then I have an Output element that contains Sections, and each Section element has a Record element consisting of several Field elements.
Now my issue is that I have two different type Field elements, one for input fields and one for output fields. The output fields have several extra attributes such as maxWidth, format, etc. and they need a link to an input field. I would like to define one single Field element, but use child elements to differentiate between input and output fields etc. I'm thinking of placing e.g. format data into a new Format element that I could add to a Field element when it is an output field.
Suggestions, recommendations, criticism etc. are all welcome.
I do not believe they are right who say that the defects of famous men should be ignored. I think it is better that we should know them. Then, though we are conscious of having faults as glaring as theirs, we can believe that that is no hindrance to our achieving also something of their virtues. - W. Somerset Maugham
My New Blog
|
|
|
|
|
Add an attribute to your single Field element that will determine its type:
...
<io type="input">
<!-- child input elements -->
</io>
<io type="output">
<!-- child output elements -->
</io>
...
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Thanks, I like that idea, but I've decided to go with a single collection of Field elements, all being output fields. The data source already provides input fields, so while RDL uses the extra indirection of mapping a set of report fields to data source fields, and then report elements, like textbox, to report fields, I don't need that. My 'report fields' are my output fields.
I do not believe they are right who say that the defects of famous men should be ignored. I think it is better that we should know them. Then, though we are conscious of having faults as glaring as theirs, we can believe that that is no hindrance to our achieving also something of their virtues. - W. Somerset Maugham
My New Blog
|
|
|
|
|
Hi Friends,
I am working on Javascript and I have some XML data in an object. Now I want to show that data using document.writeline() as it is.
means
I want to show the XML with all its node tags.
Please give me solution.
Thanks in advance.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
You will need to display it as text. You will need to especially change "<" to "<"! Some other character combinations may give you trouble also.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi guys,
If possible do any of you know how I can pass a List<string> object to my xslt which will form part of my SQL query?
This is what I'm tryin to achevive:
First of all I will have a class being serialized and then deserialized using XML serialized in the case Client.cs.
In the class I have a List<string> property which will return a list of Client names:
public List<string> ClientNames
Now in the next step I have an xslt that will transform my deserialized class and which will use the class properties as parameters to my SQL query.
The code within the xsl are as follows:
SELECT * FROM Client
WHERE Client.ClientFirstName IN ('Test', 'Ben', 'Tom')
Now what I'm trying to achieve is to pass the List<string> object to my SQL IN clause using xslt... is that possible?
Any help will be greatly appreciated.
R
|
|
|
|
|
I find your post unclear.
1) Are you trying to generate a SQL statement using XSLT?
if YES then...
2) as your data source for some of the SQL values you are using XML serialized from an object defined in Client.cs?
|
|
|
|
|
I have an xml similar to this :
<?xml version="1.0" encoding="UTF-8"?>
<input:root xmlns:input="cross-field-validation-namespace">
<input:event>
<input:element>UserName.SWEUserName</input:element>
<input:elementtype>INPUT</input:elementtype>
<input:eventtype>deactivate</input:eventtype>
<input:value>LOGO</input:value>
</input:event>
<input:event>
...................................
..................................
</input:event>
..........................
.........................
</input:root>
I need to transform it to the following:
.......
<properties>
<property name="element" string_value="UserName.SWEUserName"/>
<property name="elementtype" string_value="INPUT" />
<property name="eventtype" string_value="deactivate" />
<property name="value" string_value="LOGO" />
</properties>
............
i.e all child nodes under the 'event' node get transformed to the attributes of the property node(node name as 'name' attribute and value as 'string_value').
Moreover , the number and name of child nodes under the different 'event' nodes can vary.
How can we write a XSL template to convert all chiild nodes under 'event' (however much there may be) into the desired format.
|
|
|
|
|
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:input="cross-field-validation-namespace">
<xsl:template match="/input:root">
<xsl:element name="{local-name()}">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="input:event">
<xsl:element name="properties">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="*">
<xsl:element name="property">
<xsl:attribute name="name">
<xsl:value-of select="local-name()"/>
</xsl:attribute>
<xsl:attribute name="string_value">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I am new to MSXML. I am using xml interface to read a xml file in a C++ program. The code is
#include "fstream.h"
#include "string.h"
#import "msxml2.dll" named_guids raw_interfaces_only
using namespace MSXML2;
using namespace std;
void main()
{
IXMLDOMDocumentPtr m_pXmlDoc;
IXMLDOMNodePtr m_pProductNode;
HRESULT hr = m_pXmlDoc.CreateInstance(MSXML2::CLSID_DOMDocument);
_variant_t vtFileName("my_xml.xml");
VARIANT_BOOL vtRetVal;
m_pXmlDoc->load(vtFileName,&vtRetVal);
}
The program gives an exception when I load the file. On Debugging I found that the m_pXmlDoc is NULL. Why am I not get the instance? What is wrong in this piece of code?
|
|
|
|
|
You're not checking the return value from CreateInstance() . What is it returning?
|
|
|
|
|
I'm using .net 1.1
Now I have tried with the code:
System.Text.ASCIIEncoding encoder=new System.Text.ASCIIEncoding();
byte bytes=encoder.GetBytes(p_strXmlFrag); //Here its giving error
MemoryStream ms=new MemoryStream(bytes);
XmlWriter writer=XmlWriter.Create(ms); //Here it could not find create method
ms.Position=0;
XmlTextReader.xmlFile=new XmlTextReader(ms);
----
----
----
----
------------------------------------------------------------------------------------------------------------------------------------------------------------------
I'm also pasting the total method code to make it clear:
public static bool Validate(string p_strMmlFrag, out string p_strErr)
{
p_strErr=string.Empty;
//starting of if statement
if m_xsc==null)
{
m_xsc=new XmlSchemaCollection();
try
{
string path=AppDomain.CurrentDomain.BaseDirectory+m_strSchema;
if (!File.Exists(path))
{
path=AppDomain.CurrentDoamin.BaseDirectory+"/bin"+m_strSchema;
}
XmlTextReader xmlFile=new XmlTextReader(path);
m_ifSchema=XmlSchema.Read(xmlFile, new ValidationEventHandler (ValidationCallBack));
//Error rises in the above line as the destination file path (stored in path variable), I have just created (the file) and it's definitely empty. I tried the above mentioned solution but it's giving error!!!!!!!!
m_xsc.Add(m_ifSchema);
}
// ending of if statement
catch
{
-----
}
-------
------
-------
------
private const string m_strSchema="StructureLinkage.xsd"
private static XmlSchemaCollection=m_xsc;
private static XmlSchema m_ifSchema;
// For the first time only m_xsc in null and after that it does not need to enter into above block of code once m_xsc is instantiated.
}
|
|
|
|