xml

  • Thread starter Thread starter SS IT Services LLC
  • Start date Start date
S

SS IT Services LLC

I need to generate an XML structure in code. Is there some assembly I
should use or is the normal method just concatinating a string and building
the XML that way?

Scott
SS IT Services, LLC
 
SS said:
I need to generate an XML structure in code. Is there some assembly I
should use or is the normal method just concatinating a string and
building the XML that way?

Scott
SS IT Services, LLC
Scot take a look at the System.Xml namespace
It might be easier to create the XML as a XmlDocument
DH
 
SS said:
I need to generate an XML structure in code. Is there some assembly I
should use or is the normal method just concatinating a string and
building the XML that way?

Build a XmlDocument and Save that or use XmlTextWriter.

Arne
 
SS said:
I need to generate an XML structure in code. Is there some assembly I
should use or is the normal method just concatinating a string and
building the XML that way?

No, don't use string concatenation, that way chances are the markup you
produce is not well-formed XML. The .NET framework has APIs like
XmlWriter to assist you in ensuring what you create is well-formed XML.
See http://msdn.microsoft.com/en-us/library/4d1k42hb(VS.80).aspx or the
section "Writing XML with the XmlWriter" in your local MSDN library copy.

There are also other options like System.Xml.XmlDocument or like
System.Xml.Linq.XDocument (in .NET 3.5) if you want/need to manipulate
an existing XML document.
 
Back
Top