<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="functions" page="intro" subpage="serialize-json"/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: serialize-json</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: serialize-json"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>serialize-json</h1>
      <p>This function serializes the supplied value in JSON format.</p>
      <p class="subhead">serialize($arg as item()*) &#8594; xs:string</p>
      <table>
         <tr>
            <td width="470" align="left" colspan="4" style="border-top:solid 1px #3D5B96; ">
               <p>
                     <i>Arguments</i>
                  </p>
            </td>
         </tr>
         <tr>
            <td width="40">
               <p> </p>
            </td>
            <td width="80" valign="top">
               <p>$arg</p>
            </td>
            <td valign="top" width="150">
               <p>item()*</p>
            </td>
            <td valign="top" width="200">
               <p>The value to be serialized as a JSON string</p>
            </td>
         </tr>
         <tr>
            <td colspan="2"
                style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;">
               <p>
                     <i>Result</i>
                  </p>
            </td>
            <td style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;"
                colspan="2">
               <p>xs:string</p>
            </td>
         </tr>
      </table>
      <p class="subhead">serialize($arg as item()*, $options as map(*)) &#8594; xs:string</p>
      <table>
         <tr>
            <td width="470" align="left" colspan="4" style="border-top:solid 1px #3D5B96; ">
               <p>
                     <i>Arguments</i>
                  </p>
            </td>
         </tr>
         <tr>
            <td width="40">
               <p> </p>
            </td>
            <td width="80" valign="top">
               <p>$arg</p>
            </td>
            <td valign="top" width="150">
               <p>item()*</p>
            </td>
            <td valign="top" width="200">
               <p>The value to be serialized as a JSON string</p>
            </td>
         </tr>
         <tr>
            <td width="40">
               <p> </p>
            </td>
            <td width="80" valign="top">
               <p>$options</p>
            </td>
            <td valign="top" width="150">
               <p>map(*)</p>
            </td>
            <td valign="top" width="200">
               <p>JSON serialization optionss</p>
            </td>
         </tr>
         <tr>
            <td colspan="2"
                style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;">
               <p>
                     <i>Result</i>
                  </p>
            </td>
            <td style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;"
                colspan="2">
               <p>xs:string</p>
            </td>
         </tr>
      </table>
      <p class="subhead">Links to W3C specifications</p>
      <p>Namespace: http://www.w3.org/2005/xpath-functions</p>
      <p>Applies to: XSLT 3.0 only (if enabled in Saxon: requires Saxon-PE or Saxon-EE)</p>
      <p>
            <a href="http://www.w3.org/TR/xslt-21/#function-serialize-json" class="bodylink">XSLT 2.1 Specification</a>
         </p>
      <p class="subhead">Notes on the Saxon implementation</p>
      <p>This function is specified in XSLT 3.0,
         and is newly supported in Saxon 9.4, provided XSLT 3.0 is enabled.</p>
      <p>The options recognized are <code>escape=true|false</code>, <code>indent=true|false</code>,
         <code>spec=RFC4234|ECMA-262</code>, <code>fallback=(function)</code>.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="sin.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>