|
|
Hi,
My work is being done on Visual C++ 2002, MSXML 3.0.
I am using the "save" method to write the XML document data to file. How does one set the writing to print each node on a different line instead of the entire data on one line?
thanks
|
|
|
|
|
i'm a xml newbie.
i'm reading a book about XSLT, here is a paragraph i can't understand
XM+L Namespaces 1.1 became a Recommendation on 4 February 2004, and the XSLT 2.0 specification makes provision for XSLT processors to work with this version, though it isn't required. Apart from the largely cosmetic change from URIs to IRIs mentioned earlier, the main innovation is the ability to undeclare a namespace, using a namespace undeclaration of the form «xmlns:prefix=""». This is particularly intended for applications like SOAP messaging, where an XML payload document is wrapped in an XML envelope for transmission. Without namespace undeclarations, there is a tendency for namespaces used in the SOAP envelope to stick to the payload XML when this is removed from the envelope, which can cause validation failures and other problems. For example, it can invalidate a digital signature attached to the document.
what's xml payload?
|
|
|
|
|
The payload is just the XML document that the SOAP envelop exists to deliver. It's no different from any XML document.
HeartFriend wrote:
Without namespace undeclarations, there is a tendency for namespaces used in the SOAP envelope to stick to the payload XML when this is removed from the envelope, which can cause validation failures and other problems. For example, it can invalidate a digital signature attached to the document.
This means if your xml does not use namespaces, it will inherit the SOAP namespace, and this will cause XSD's to fail, etc.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Friends,
I have to xml files with on common field them.
How can I display data from both the file using dataview and dataset.
Plz send me reply soon. Its very urgent.
Thank u all in advance.
|
|
|
|
|
Not all xml file can be shown on the grid, It has to be in proper schema, or manually you have to file in a DataTable of a DataSet.
Whenever a DataSet is writen into a xml file, it format the xml file in a recognized format, and preferable with its schema. The same xml file can be read into a DataSet. And at last , DataSource property of DataGrid can be set to that DataSet to show the xml file.
Refer : DataSet.Load(), DataSet.WriteXml() for further information.
love2code
|
|
|
|
|
Hi,
Thanx for ur Reply.
U suggested a good way to user xml schema.
I am using schemas to store data in xml file.
I think there are some methods using which we can put a relation ship between two tables in xml file.
But I dont know how use them properly.
If u know this way then plz let me know.
Thank u again.
|
|
|
|
|
In my ASP.NET application I read a table from the database, and then translate it into HTML via XSL file. The problem is that some columns in my table contain raw data that need to be processed before displayed. For some columns i could do it within XSL like shown below:
For the image column:
<xsl:element name="img">
<xsl:attribute name="src">
ShowImage.aspx?id=<xsl:value-of select="UserNumber"></xsl:value-of>
</xsl:attribute>
<xsl:attribute name="width">
137
</xsl:attribute>
<xsl:attribute name="height">
150
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:text>None</xsl:text>
</xsl:attribute>
</xsl:element>
For the boolean column:
<xsl:choose>
<xsl:when test="Enabled=1">
<xsl:text>Yes</xsl:text>
</xsl:when>
<xsl:otherwise>
No
</xsl:otherwise>
</xsl:choose>
Now, the question is: How do i do a similar pre-processing, but for some complex binary columns that come as an integer, and via complex transformation must become text?
Is there like a way to do data decoding right in XSL? Or should I intercept XSL processing somehow when i'm calling method Transform of class XslTransform?
|
|
|
|
|
Hallo all,
I'd like to do the following: to draw a rectangle with the text inside such that, if the length of the text (in pixels) is longer than rectangle width, then the text should be adjusted to the width of rectangle. If the text can be put inside a rectangle without any changes, adjusting is not needed. Also the font size of the text should be somehow related to the size of the rectangle (which is given relatively, in percents, like <rect width="3%" height="2%" /> ), but it doesn't work, if one writes e.g. font-size = "1%" ...
As for text adjusting, if I use the textLength attribute (i.e. set it equal to rectangle width), then the text will be _always_ adjusted to the rectangle width, even if there is enough space for the text in initial state, what would be not so wished...
As one can see, textLength atribute can not be used as well as relative text size (in %) doesn't work. What can I do in such a case? The only solution as I see is usage of JavaScript and calculation of text size and adjusting already on the client side... But it would not be very well, may be there are another approaches to the problem?
Many thanks in advance.
|
|
|
|
|
About rectangle, it should be read like:
"...which is given relatively, in percents, like <rect width=3% height=2% /> ..."
|
|
|
|
|
I am new to XML and I am trying to get an asterisk to show up using CDATA, it seems to ignore this. I need an asterisk to show up on the page after the city name. If someone could help me out I would sure apprecite it.
<city_name>
|
|
|
|
|
Hi,
I've written data from a dataset to xml with ds.WriteXml.
The problem is that empty fields in a record are written as empty elements in the xml-file.
Example
<fax>
<mobiel>
<email>
The best option is to avoid these empty elements directly at the WriteXml-method of the dataset.
The second option is to read the xml-file after construction, remove al the empty elements from it and save.
After searching the web i couldn't find any suitable solution for this problem. Can someone help me?
Note that the xml-file contains nested elements. Some of the nested elements can be empty also.
thanks
Ruud
|
|
|
|
|
then what is your problem ?? do u need to write non empty element only ??
love2code
|
|
|
|
|
Indeed, only the elements who have content need to be written from the dataset to xml.
Otherwise, a solution who will remove all the empty elements from the output xml-file would be a good alternative.
Every solution is right.
Ruud
|
|
|
|
|
Hai...
1. How can i send request post soap envelope in vb.net???
2. how i can get msxml??
Thank's....
Donnylie
|
|
|
|
|
i have a xml file , it looks like this:
<config>
<language name = "EN" output = "C:\" />
<language name = "CN" output = "D:\" />
.
.
.
</config>
i wrote a xdr file like this , but it doesn't work, i know there must be something wrong with my schema file, could u help me correct this file?
<?xml version="1.0" encoding="UTF-8" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data">
<ElementType content = "eltOnly" name = "config" order = "one" model = "closed">
<ElementType content = "empty" name = "language" order = "one" model = "closed">
<AttributeType name = "name" dt:type="string" required = "yes"/>
<AttributeType name = "output" dt:type="string" required = "yes"/>
</ElementType>
<element type = "language" minOccurs = "1" maxOccurs = "*" />
</ElementType>
</Schema>
|
|
|
|
|
where from [dt:type="string"] is coming into the picture, did you specify the namespace ???
love2code
|
|
|
|
|
i have a xml schema file and a xml file which is to be validated?
how to use them in my vc program?
|
|
|
|
|
(i'm reposting, first time i posted i wasn't logged in )
hello
i have an xsd with a tag from type "xsd:time". <REGTIME>
when i generate a sample xml file with XML spy i get this sample filled in: <REGTIME>14:20:0Z</REGTIME>
now when i try to parse this file with the .NET xpathdocument the application crashes on this line:
XPathDocument document = new XPathDocument(readerToUse);
(readerToUse is of type xmlreader)
it crashes and says this string in REGTIME is not a valid string for type DATETIME.
so i assume .NET recognizes the xsd:time field, but says it's invalid, why? xmlspy says it's ok.
i hope someone can help me out here.
thank you
-- modified at 9:48 Monday 29th August, 2005
|
|
|
|
|
hello
i have an xsd with a tag from type "xsd:time".
when i generate a sample xml file with XML spy i get this sample filled in: <regtime>14:20:0Z
now when i try to parse this file with the .NET xpathdocument the application crashes on this line:
XPathDocument document = new XPathDocument(readerToUse);
(readerToUse is of type xmlreader)
it crashes and says this string in REGTIME is not a valid string for type DATETIME.
so i assume .NET recognizes the xsd:time field, but says it's invalid, why? xmlspy says it's ok.
i hope someone can help me out here.
thank you
|
|
|
|
|
I'm trying to use MSXML 4 DOM to parse a xml document in Visual C++, but without success. A snippet of the xml structure is a following:
<data>
<album label="Album title 1">
<track label="Label 1" sndUrl="1\0.jk" txtUrl="1\0.jk"/>
<track label="Label 2" sndUrl="1\1.jk" txtUrl="1\0.jk"/>
</album>
<album label="Album title 2">
<track label="Label 1" sndUrl="2\0.jk" txtUrl="2\0.jk"/>
<track label="Label 2" sndUrl="2\1.jk" txtUrl="2\0.jk"/>
</album>
</data>
Can anyone give me a code snippet to parse album label, track label, sndUrl, txtUrl attributes to a CString?
Please help!
Thanks in advance for any answers.
|
|
|
|
|
Hi
I am trying to upload the XML file to parse it. While I upload it I am getting this error:
System.Xml.XmlException: The '0' character, hexadecimal value 0x30, cannot begin with a name. Line 726, position 2823.
Somwtimes I also get invalid character exception.
I am parsing many XML files in a "for loop" after downloading it from a website automatically. Is their anyway to ignore these exceptions and able to load the document or a way to solve this problem with XML files through a progam, so that I dont have to manually handle such characters in the file?
Any help would be appreciated.
Thanks
rscr
|
|
|
|
|
Hi, I am new to manipulating XML with C#.
I want to know how to retrieve an element value.
I have this vey simple XML file :
<?xml version="1.0" encoding="utf-8"?>
<people>
<person>
<Lname> Washington </Lname>
<FName> George </Fname>
</person>
<person>
<Lname> Lincoln </Lname>
<Fname> Abraham </Fname>
</person>
</people>
All I need is a simple method :
public string GetFname(string Lname)
{
...
}
which returns the first name by last name.
Thanks a lot!
|
|
|
|
|
hi,
There are some different ways how you can do that. Maybe easiest (but not necessary most effective) is this:
XmlDocument doc = new XmlDocument();
doc.Load( fileNameofYourXml )
while( doc.Read() )
{
if( doc.Name == "Lname" && doc.Value == Lname )
{
doc.Read();
return doc.Value;
}
}
OR you can go with XPath:
doc.SelectSingleNode( string.Format("/person/following-sibling::Lname='{0}'", Lname) );
But I bet I got syntax for that XPath expresion wrong
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Hi, thanks for your reply,
In fact I tried the first method. It doesn't work.
1-XmlDocument has no method Read, (only a method ReadNode which take a reader as argument! No idea how it works)
2-Instead I used XmlTextReader, still not working. One remark: when I display all the Values and Names in a label, I get many of them null. Other think, they are always the same : value=name?
Any hint?
For the Xpath method didn't try it.
Thanks.
|
|
|
|