|
-
Nov 4th, 2012, 07:03 PM
#1
Thread Starter
Hyperactive Member
XmlTextWriter
Hi,
in the text file i get < names > how to get <names>
Dim xmlDoc As XmlDocument = New XmlDocument
xmlDoc.LoadXml(ds.GetXml)
Dim Output As New XmlTextWriter(fileLoc, System.Text.Encoding.Default)
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<xml>
<XML_F52E2B61-18A1-11d1-B105-00805F49916B>< names >< name="Sam"/>
thanks
-
Nov 4th, 2012, 09:47 PM
#2
Re: XmlTextWriter
The reason would be that you're writing XML as values in an XML file. If you want to save a DataSet to an XML file then you simply call the WriteXml method of the DataSet.
-
Nov 4th, 2012, 10:16 PM
#3
Thread Starter
Hyperactive Member
Re: XmlTextWriter
Im actualy doing an sql xml query so the data is returned in xml format, i also tried using ds.writeXml() method, nothing changed though
-
Nov 4th, 2012, 10:53 PM
#4
Re: XmlTextWriter
OK then, what you're getting is exactly what you should be getting. If you're writing XML inside XML then that's what you'll get. Obviously you can't have chevrons inside chevrons, e.g.
Code:
<someElement value="<someValue>">
The inner data has to be escaped and that's why you see < and >. That's the way it works so that's what you get. If you replace them with < and > then you will not have valid XML.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|