472,098 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,098 software developers and data experts.

System.Xml.XmlDocument with (x)html entities

Hello all,

I'm having a bit of a problem with System.Xml.XmlDocument. The scenario
is as follows:

I receive a dataset containing some data fetched from database. I can
retrieve a string containing the data with Dataset.GetXml method.
Inside the xml document, in a datatable field, I have an xhtml document
that may contain xhtml entities (for example   or '). When I
do a XmlDocument.LoadXml, these xhtml entities crash the LoadXml
method.

I've tried looking into the XmlResolver class, but haven't found a way
to get it to work with XmlDocument. Anyone?
TIA,

Sdr

Aug 20 '06 #1
3 3846
pe*******@gmail.com wrote:
I'm having a bit of a problem with System.Xml.XmlDocument. The scenario
is as follows:

I receive a dataset containing some data fetched from database. I can
retrieve a string containing the data with Dataset.GetXml method.
Inside the xml document, in a datatable field, I have an xhtml document
that may contain xhtml entities (for example   or '). When I
do a XmlDocument.LoadXml, these xhtml entities crash the LoadXml
method.
You can make your XML well-formed by adding a DOCTYPE to (X)HTML DTD
containing entity definitions -
http://www.w3.org/TR/xhtml-modulariz...acter_Entities

--
Oleg Tkachenko [XML MVP, MCPD]
http://blog.tkachenko.com | http://www.XmlLab.Net | http://www.XLinq.Net
Aug 21 '06 #2
Thanks for your answer Oleg,

this will not solve my problem. Due to a number of reasons, and can't
add doctype definitions to the actual xml document. I receive a
System.Data.DataSet from DAL layer, and have to take this for granted.
I suppose the actual question here is how to do the exact same thing
programatically.

Sdr

Aug 21 '06 #3

Hello all,

I managed to find a solution. I found a good code example at Scott
Willeke's blog
(http://blogs.pingpoet.com/overflow/a...05/07/20.aspx). Looking
at the solution, no wonder I couldn't figure this one out right away.
Scott, if you're reading this, keep up the good work.

Sdr

Aug 21 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Microsoft News | last post: by
1 post views Thread by Martin Honnen | last post: by
1 post views Thread by AJ Brown | last post: by
5 posts views Thread by Ben R. | last post: by
reply views Thread by Dan | last post: by
14 posts views Thread by jens Jensen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.