Jump to content

add HTML in XML


joecool2005

Recommended Posts

yes, the best thing to do is to escape the html tag carrots:

<myTest><h1>Hello World</h1></myTest>

Link to comment
Share on other sites

...or simply putting the empty tags in CDATA sections. If there are many, then placing the whole HTML in CDATA is also an option.Note: The example you provided could actually be put directly. XML could store all kinds of data. It only depends if the other language you use would understand that the content of <myTest> is actually HTML and that depends totally on you. The only thing which you can't place in XML would be non closed empty tags such as <br>, <img>, etc. (you can place their XHTML equivalents <br />, <img />, etc. though). In that case, you would use one of the above methods.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...