I use an XmlTextWriter to generate xml data.
The declaration is:
System.Text.StringBuilder sb = new System.Text.StringBuilder();
System.IO.StringWriter sw = new System.IO.StringWriter(sb);
XmlTextWriter w = new XmlTextWriter(sw);
And I write to it using
When the creation is done, I need to load it into DOM to select an
XmlNode or an XmlElement to apply to another method (which I cannot
I thought I could do it with:
XmlDocument xDoc = new XmlDocument();
XmlNode node = xDoc.SelectSingleNode("sub-header");
XmlNode axaptaData = SomeManager.TransferDataToAxapta(node);
But at run-time I get an error saying:
"the path is too long after being fully qualified"
(when the .Load()-method is executed)
How do I get arround this?
.... and also:
The XmlTextWriter inserts the XmlDeclaration as
<?xml version="1.0" Encoding="utf-16" ?>
Is there any wy to make it write it as utf-8? I cannot apply the Encoding
as the constructor of the class, since it will then not accept my
StringWriter as first parameter.
Can you help me out with this one?
Jesper Stocholm http://stocholm.dk
Programmer's code comment:
//It probably makes more sense when you're stoned.