Bryan:
The following code sample would create a similar document.
Private Sub btnXML_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnXML.Click
Dim doc As XmlDocument = New XmlDocument
Dim dec As XmlDeclaration = doc.CreateXmlDeclaration("1.0", "UTF-16",
String.Empty)
Dim eResults As XmlNode = doc.CreateElement("Results")
doc.InsertBefore(dec, doc.DocumentElement)
doc.AppendChild(eResults)
Dim eOrderNum As XmlNode = doc.CreateElement("OrderNumber")
eOrderNum.InnerText = "123456"
eResults.AppendChild(eOrderNum)
Dim eError As XmlNode = doc.CreateElement("Error")
eError.InnerText = "[Error messages, if any, go here]"
eResults.AppendChild(eError)
doc.Save(("C:\TestXML.xml"))
End Sub
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com
This response is supplied "as is" without any representations or warranties.
"Bryan Dickerson" <tx******@netscape.net> wrote in message
news:eL**************@TK2MSFTNGP11.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>123456</OrderNumber>
<Error>[Error messages, if any, go here]</Error>
</Results>
.... what would a sample piece of code look like?
Thanx!
"David Lloyd" <Da***@NoSpamPlease.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******@netscape.net> wrote in message
news:%2****************@tk2msftngp13.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