Loading ...
Sorry, an error occurred while loading the content.

Re: [XSL-FO] Character entity Reference.

Expand Messages
  • Eliot Kimber
    ... With XSLT 2 you can use the character map feature to map specific characters to any string in the output, including an entity reference. However, this
    Message 1 of 5 , Aug 24, 2005
    • 0 Attachment
      touchlenin wrote:
      > Greetings to all,
      >
      > Does anyone know, how to retain the Character entity reference in
      > the output XML after XSL transformation.

      With XSLT 2 you can use the character map feature to map specific
      characters to any string in the output, including an entity reference.
      However, this requires you to define a mapping for each
      character--there's no way to have a generalized entity-preserving mechanism.

      One way to do this out side of, but in concert with your XSLT processor,
      is to create a custom SAX filter that escapes entity references before
      the XML data stream is passed to the XSLT processor. For example, you
      could use the SAX filter to change entity references to elements and
      then use template rules to output the corresponding entity reference for
      those tags, e.g.:

      ˜ -> SAX filter -> <mystuff:entityref name="tilde"/> -> XSLT:

      <xsl:template match="mystuff:entityref">
      <xsl:text disable-output-escaping="yes">&</xsl:text>
      <xsl:value-of select="@name"/>
      <xsl:text>;</xsl:text>
      </xsl:template>

      Cheers,

      E.
      --
      W. Eliot Kimber
      Professional Services
      Innodata Isogen
      9390 Research Blvd, #410
      Austin, TX 78759
      (512) 372-8155

      ekimber@...
      www.innodata-isogen.com
    Your message has been successfully submitted and would be delivered to recipients shortly.