Dataset WriteXML

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the WriteXml method to generate an XML doc. The method adds the
xmlns = "http://mywebsiteaddress/myschema.xsd to my root element. I also
have an XSL with a for-each loop that transforms my XML into HTML. If I
manually delete the xmlns section from the XML' root element, the XSL works
and displays fine. With the xmlns section my XSL does not read any of the
data. Do I have to add anything to my XSL or can I disable WriteXml from
adding the xmlns. Thank you very much ahead of time.

Nick
 
Nick,

A dataset is not real an XML document. It is a dataset that is serialized in
a XML file. Don't mix XML types of files. A dataset has by instance only
elements while a document uses attributes.

I hope this gives an idea.

Copr
 
Thanks good idea, but the default mode is already ignoreschema (otherwise it
puts much more info in the xml) and it still adds the xmlns: to my root
element. Thanks again.

Nick
 
Thanks Sahil,

Great Idea, but when I try I crash with "Cannot change the name of the
DataSet to an empty string" so I just tried to put any string and it still
wrote the original xsd. I think that method maybe used just for reading xml?
Thanks again.

Nick
 
Thanks for you help. I deleted the namespace references in my typed datased
and now it does not generate the xmlns.

Nick
 
Back
Top