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
11.74Mb size Format: txt, pdf, ePub
ads

,
<
, 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.)
BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
11.74Mb size Format: txt, pdf, ePub
ads

Other books

3 Christmas Crazy by Kathi Daley
Glass Ceilings by A. M. Madden
How to Fall in Love by Cecelia Ahern
A Rockstar's Valentine by K.t Fisher, Clarise Tan
C.R.O.W. (The Union Series) by Richards, Phillip