[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Xslt 2.0 disable-output-escaping attributes

Subject: RE: [xsl] Xslt 2.0 disable-output-escaping attributes
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Mon, 26 Jan 2004 17:33:08 -0000

Ok if I actually read the spec :) I would have seen:

<xsl:character-map name="style">
  <xsl:output-character character=">" string="&gt;"/>

Used in conjuction with:

<xsl:output use-character-maps="style"/>

Two things Ive noticed about this:

1.  http://www.w3.org/TR/xslt20/#element-output-character

The spec here uses the example

<xsl:character-map name="jsp">
  <xsl:output-character char="«" string="&lt;%"/>   
  <xsl:output-character char="»" string="%&gt;"/>
  <xsl:output-character char="§" string='"'/>

Where the @char should be @character.

2.  For some reason, adding the above character map affects the &lt; in my script block.  For example,

 while (a &lt; el.childNodes.length) {

Without the above character map comes out as an entity unchanged, but with the above map it comes out as '<'

This is highlighted in the following example:

  Hello &lt; &gt; World

<xsl:stylesheet version="1.0"

<xsl:output use-character-maps="root"/>

<xsl:character-map name="root">
  <xsl:output-character character=">" string="&gt;"/>


<?xml version="1.0" encoding="UTF-8"?>
  Hello < > World

I would have expected the left angle bracket to still be an entity - is this correct?  


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread