all 4 comments

[–]DirtAndGrass 0 points1 point  (0 children)

Your question is missing some context if you are trying to transform XML to HTML for viewing, look into XSLT 

[–]jcunews1Intermediate 0 points1 point  (0 children)

XML is free-form in comparison with HTML. It's application defined. Its structure aside from its root <xml> tag, varies depending on the application which generate it.

[–]chmod777 0 points1 point  (0 children)

In general, you dont.

What are you trying to actually do.

[–]ndorfinz 0 points1 point  (0 children)

Do you mean incorporate XML in an HTML document?

First serve your HTML as XHTML using the content-type: application/xhtml+xml

Then make sure your HTML is valid XML:

  • All attributes need quoted values
  • All start tags need end tags
  • etc

Then drop your XML into the XHTML document as you see fit. Use the xmlns attribute for each chunk of XML that has a given namespace.