Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embed HTML in XML

Status
Not open for further replies.

James1981

Programmer
Nov 2, 2002
76
0
0
US
Hi,

I want to embed HTML within my XML document. Due to the tags, HTML causes the XML parser not to function... One way round this is to use the HTML entities instead (e.g. <).. is there anyway to automatically convert HTML tags into their entities?

Cheers

James
 
Can you post XML code? Assuming all your HTML is valid and any single tags (e.g. IMG, BR, HR) have proper XHTML/XML closing syntax (e.g. <IMG .... />) then there is no reason why XML Parser should have nay problems with HTML embedded in XML document. Unless you are trying to embed HTML in the valeu of an XML attribute? IN whcih case you may wish to rethink your XML or alternatively use

Server.HTMLEncode(HTMLstring)

to convert non alphanumeric characters to HTML entities - of course these will then need unencoding if you wish to send as HTML....

Hope this helps

Rob

------------------------------------

Go placidly amidst the noise and haste,
find what peace there may be in silence.
-Anon

------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top