<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="extensions" page="output-extras" subpage="recognize-binary"/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: The saxon:recognize-binary attribute</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title"
            content="Saxonica: XSLT and XQuery Processing: The saxon:recognize-binary attribute"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>The saxon:recognize-binary attribute</h1>
      <p>This attribute is relevant only when using the text output method. If set to yes, the processing instructions <code>&lt;?hex XXXX?&gt;</code> and <code>&lt;?b64 XXXX?&gt;</code> will be 
recognized; the value is taken as a hexBinary or base64 representation of a character string, encoded using the encoding in use by
the serializer, and this character string will be output without validating it to ensure it contains valid XML characters. Also
recognized are <code>&lt;?hex.EEEE XXXX?&gt;</code> and <code>&lt;?b64.EEEE XXXX?&gt;</code>, where EEEE is the name of the encoding
of the base64 or hexBinary data: for example <code>hex.ascii</code> or <code>b64.utf8</code>.</p>
      <p>This enables non-XML characters, notably binary zero, to be output.</p>
      <p>For example, given <code>&lt;xsl:output method="text" saxon:recognize-binary="yes"/&gt;</code>, the
following instruction:</p>
      <p><code>&lt;xsl:processing-instruction name="hex.ascii" select="'00'"/&gt;</code></p>
      <p>outputs the Unicode character with codepoint zero ("NUL"), while</p>
      <p><code>&lt;xsl:processing-instruction name="b64.utf8" select="securityKey"/&gt;</code></p>
      <p>outputs the value of the <code>securityKey</code> element, on the assumption that this is base64-encoded UTF-8 text.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="require-well-formed.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>