Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Encoding Problem

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 2/5/2008 11:33:00 AM

BillGatesFan wrote:
> Why can't I do this?
> 
> a.CreateTextNode("<a>hi</a><b>bye</b>")
> 
> 
> 
> It comes out like "%ltagt% .....

It would result in "&lt;a&gt;...".

> How can I fix this?

Well don't create a text node, parse that string into nodes. How you do 
that depends on the API you are using.
If you let us know whether you use MSXML or .NET then we can tell you 
more. With .NET it is easy, if you create a new document, use LoadXml, 
if you want to parse additional markup, use an XmlDocumentFragment and 
set its InnerXml:
       XmlDocument doc = new XmlDocument();
       doc.LoadXml(@"<root><foo>bar</foo></root>");
       XmlDocumentFragment fragment = doc.CreateDocumentFragment();
       fragment.InnerXml = "<a>hi</a><b>bye</b>";
       doc.DocumentElement.AppendChild(fragment);
       doc.Save(Console.Out);


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent