Controlling Output Type

A lot of the examples in this chapter have converted XML into HTML, and you might have wondered how an XSLT processor knows to omit the <?xml?> declaration from the beginning of such output documents. It turns out that there's a special rule here: If the document node of the output document is <HTML>, the XSLT processor knows that the output document type is HTML and writes the document accordingly.

In fact, you can specify three types of output documents:

  • XML This is the default, and such documents start with an <?xml?> declaration. In addition, entity references are not replaced with characters such as < or & in the output document; the actual entity reference appears in the output.

  • HTML This is standard HTML 4.0, without ...

Get Real World XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.