Project

Profile

Help

Support #3065 » serialize-character-encoding.xsl

Nick Nunes, 2016-12-10 02:07

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs">
<xsl:template name="main">
<xsl:variable name="output" as="element()+">
<h3>Test</h3>
<p>Some <b>bold</b> and <i>italic</i> text. 'Single quoted text' and "double quoted text".</p>
</xsl:variable>
<xsl:variable name="serialization-parameters" as="element()">
<output:serialization-parameters
xmlns:output="http://www.w3.org/2010/xslt-xquery-serialization">
<output:method value="html"/>
<output:indent value="yes"/>
<output:use-character-maps>
<output:character-map character="&#34;" map-string="&quot;"/>
<output:character-map character="'" map-string="&#39;"/>
</output:use-character-maps>
</output:serialization-parameters>
</xsl:variable>
<meta name="citation_abstract" content="{serialize($output,$serialization-parameters)}"/>
</xsl:template>
</xsl:stylesheet>
(2-2/2)