RE: request, unparsed-entity-references

As David Carlisle pointed out, you've unfortunately got your terminology
wrong: you are in fact referring to parsed entity references rather than
unparsed entities.

A major reason that we added character maps to XSLT 2.0 was to provide a
solution to this kind of difficulty. It's not a completely clean
solution; the data model knows nothing about parsed entities or entity
references, which makes a clean solution very difficult. What character
maps allow you to do, however, is to replace every "$" sign in the
result tree with the entity reference "$" in the serialized
output.

I would be grateful if you could take a look at the xsl:character-map
facility in XSLT 2.0 and confirm whether it meets your requirements. If
it does, this will enable us to close this comment without adding it to
the long agenda of the XSL Working Group.

Regards,

Michael Kay

> -----Original Message-----
> From: public-qt-comments-request@w3.org 
> [mailto:public-qt-comments-request@w3.org] On Behalf Of 
> Christopher G D Tipper
> Sent: 16 February 2004 17:52
> To: public-qt-comments@w3.org
> Subject: request, unparsed-entity-references
> 
> 
> 
> XSLT 2.0 recommendation states "XSLT 2.0 provides no facility 
> to construct unparsed entities within a tree"
> 
> I think this is a mistake.
> 
> Problem Summary:
> 
> When transforming using intermediate formats I frequently 
> find that entity references are resolved too early. One 
> solution would be to use a catalog to switch entity sets 
> dynamically, but don't know of such on my platform.
> 
> Scenario, Problem details
> 
> My situation is as follows:
> 
> I have a TeX based parsing package which has problems with 
> the '$' character. So I use the $ entity, but then I 
> find that HTML output doesn't resolve this entity and I find 
> the literal $ in my HTML output.
> 
> To work around this problem I use a <dollar/> element and 
> have to put the following in my stylesheet:
> 
>   <xsl:template match="dollar">$</xsl:template>
> 
> This is a problem for every stylesheet that starts from this 
> source, and I find the process both confusing and inelegant.
> 
> Solution, Request
> 
> What I would like is a new parameter, so that I could write 
> the following, which would remove a lot of headaches 
> transforming between multiple output DTDs. 
> 
>   <xsl:template match="text()">
>      <xsl:value-of select="." unparsed-entity-references="yes"/>
>   </xsl:template>
> 
> So much better with 'unparsed-entity-references' at the head 
> of the stylesheet. Then I can use <!ENTITY dollar "&#x0024;"> 
> <!-- DOLLAR SIGN --> in my local DTD, and pass on the entity 
> reference to intermediate DTDs.
> 
> Best wishes,
> Christopher Tipper
> --------------------------------o00o--------------------------------
>   "Since light travels faster than sound, isn't that why 
>    some people appear bright until you hear them speak" 
>                                           - Steve Wright
> 

Received on Tuesday, 17 February 2004 17:31:36 UTC