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

Re: Understanding character handling


Subject: Re: Understanding character handling
From: Keith Visco <kvisco@xxxxxxxxx>
Date: Fri, 08 Jan 1999 12:43:48 -0500

keshlam@xxxxxxxxxx wrote:

> User-created entities are a different kettle of worms. According to the DOM
> spec, a validating parser _can_ retain the fact that data was obtained via
> an entity reference -- but doesn't have to. In the former case, you know
> which entity was used and you can recreate the reference on output. In the
> latter approach, that information is lost. If this is important to you, use
> it as a guide in selecting parsers. (I'm not defending the fact that it was
> left open, just pointing out the hazard.)
> 


I do feel something should be done about this, if I am understading
everyone correctly. For example the xsl identity example given in the
xsl wd:

--- from XSL WD 19981216
<xsl:template match="*|@*|comment()|pi()|text()">
  <xsl:copy>
    <xsl:apply-templates select="*|@*|comment()|pi()|text()"/>
  </xsl:copy>
</xsl:template>
---

 will not produce a "true" identity of the following xml if the entity
references are expanded by the parser choosen for the xsl processor
implementation:

<my-element>
  &my-entity;
</my-element>

And different results  may occur depending on which processor you
choose, if the entity reference is lost in one, but not in the other.


And on to a related topic. I am in favor of the "xsl:entity-ref" that
another subscriber suggested. In which case I would be able to create
enities in my
xsl stylesheet that apply to the DTD of the resulting XML
transformation.

<xsl:entry-ref name="nbsp"/>

would give me my desired &nbsp; in the result document.

--Keith


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



Current Thread
Keywords