joecool2005 Posted May 17, 2006 Share Posted May 17, 2006 Hi,I want to do something like this<myTest> <h1>hello world</h1> </myTest>Is it possible to add HTML in XML?ThxJoe Link to comment Share on other sites More sharing options...
Skemcin Posted May 17, 2006 Share Posted May 17, 2006 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 More sharing options...
boen_robot Posted May 17, 2006 Share Posted May 17, 2006 ...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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now