Bryan:
The following code sample would create a similar document.
Private Sub btnXML_Click(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles btnXML.Click
Dim doc As XmlDocument = New XmlDocument
Dim dec As XmlDeclaration = doc.CreateXmlDe claration("1.0" , "UTF-16",
String.Empty)
Dim eResults As XmlNode = doc.CreateEleme nt("Results")
doc.InsertBefor e(dec, doc.DocumentEle ment)
doc.AppendChild (eResults)
Dim eOrderNum As XmlNode = doc.CreateEleme nt("OrderNumber ")
eOrderNum.Inner Text = "123456"
eResults.Append Child(eOrderNum )
Dim eError As XmlNode = doc.CreateEleme nt("Error")
eError.InnerTex t = "[Error messages, if any, go here]"
eResults.Append Child(eError)
doc.Save(("C:\T estXML.xml"))
End Sub
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com
This response is supplied "as is" without any representations or warranties.
"Bryan Dickerson" <tx******@netsc ape.net> wrote in message
news:eL******** ******@TK2MSFTN GP11.phx.gbl...
I think that's close, but I'm still grappling with trying to understand some
of the details and how to translate them to my situation. All that to say,
I don't get it yet.
If I want to pass back a very simple XML Document that looks like this:
<?xml version="1.0" encoding="UTF-16" ?>
<Results>
<OrderNumber>12 3456</OrderNumber>
<Error>[Error messages, if any, go here]</Error>
</Results>
.... what would a sample piece of code look like?
Thanx!
"David Lloyd" <Da***@NoSpamPl ease.com> wrote in message
news:%z******** ******@bignews7 .bellsouth.net. ..
Bryan:
The following KB article may be a useful reference, depending on your
exact
needs.
http://support.microsoft.com/default...b;en-us;317665
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com
This response is supplied "as is" without any representations or
warranties.
"Bryan Dickerson" <tx******@netsc ape.net> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Ok, I've spent all this time creating a program to read an XML Document
via
XPaths and my boss is pretty thrilled, but now I have to return an XML
document, so can someone point me to some sample code that creates an XML
Doc and adds a field/element to it?
Thanx!
--
TFWBWY...A