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
9.06Mb 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

Kindred Spirits by Julia Watts
What the Outlaw Craves by Samantha Leal
Agent Garbo by Stephan Talty
2021 by Martin Wiseman
Alex Van Helsing by Jason Henderson