XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (684 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
5.76Mb size Format: txt, pdf, ePub

,
<
, or

, because these are all equivalent according to the XML standard. The one thing it will not write is
<
. So, it doesn't matter how you write the
<
in your input: the serializer sees a
<
and escapes it in the output.

There are several valid reasons why you might not want this behavior. For example:

  • The output is not XML or HTML at all; it is (say) a data file in comma-separated-values format.
  • The output is HTML and you want to exploit one of the many HTML quirks where special characters are needed without escaping; for example, a
    <
    sign in a piece of client-side JavaScript on your HTML page.
  • The output is XML and you want to achieve some special effect that the XSLT processor doesn't allow; for example, outputting an entity reference such as
    ¤t-date;
    or an internal DTD subset containing an entity declaration.
  • The output is some format that uses angle-bracket syntax but is not pure XML or HTML; for example, ASP.NET pages or Java Server Pages, which both use
    <%
    and
    %>
    as delimiters, or XQuery, in which an unescaped
    <
    can be used as an operator symbol. (If you are generating Java Server Pages, note that these have an alternative syntax that is pure XML; however, this is not widely used.)

Other books

The Nicholas Linnear Novels by Eric Van Lustbader
A Beautiful Bowl of Soup by Paulette Mitchell
Skinny by Diana Spechler
The Broken Angel by Monica La Porta
What Could Go Wrong? by Willo Davis Roberts
December Ultimatum by Michael Nicholson
Salter, Anna C by Fault lines
Jump Shot by Tiki Barber, Ronde Barber, Paul Mantell