RE: [xsl] amp symbols

Subject: RE: [xsl] amp symbols
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 4 Jul 2006 00:14:52 +0100
It's interesting to read the following in James Clark's reply:

<quote>
Maybe a result-dtd-system-id and result-dtd-public-id attributes on
xsl:stylesheet would be a potential solution.  An XSL engine could
output the appropriate DOCTYPE declaration, but could also read the DTD
so as to find an appropriate entity corresponding to a particular
Unicode code point.
</quote>

Well, we got the doctype-system and doctype-public added to xsl:output, but
the idea of a processor reading the DTD to extract the entity definitions
was never pursued.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: David Carlisle [mailto:davidc@xxxxxxxxx] 
> Sent: 04 July 2006 00:01
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] amp symbols
> 
> 
> > ? Also, the one issue
> > that I am running into is the fact that if I try to put an entity 
> > symbol into the file such as &test; when I process the file, it 
> > converts it to &amp;test;.
> 
> Your input must have also been &amp;test; (or 
> <![CDATA[&test;]]> wich is the same thing, as otherwise you'd 
> have an undefined entity error in the stylesheet.
> 
> If your processor supports d-o-e then
> <xsl:text disable-output-escaping="yes">&amp;test;</xsl:text>
> will produce what you want, but a system is allowed to 
> silently ignore d-o-e and then gove you &amp;test; so perhaps 
> that is what you are seeing. (Which processor are you using?)
> 
> > It's like it won't allow me to use the & symbol even when 
> using it in 
> > the name of the entity.
> 
> An XSL file has to be well formed XML so that means that 
> either & has to be used as the start of a character or entity 
> reference, or it has to be quoted or equivalently in a CDATA 
> section. If it's used as an entity reference delimiter then 
> teh entity must be defined in the stylesheet, but XSLT will 
> not see the entity, it will be resolved by the XML parser 
> before XSLT starts. If you use a quted amp then that is what 
> you get in the result unless you turn off the escaping in teh 
> result tree with the d-o-e attribute.
> 
> If it makes you feel any better, you're not the first person 
> to go through this loop. Including, er, "at least one" of the 
> people responding in the current thread...
> 
> First hit that I get for
> http://www.google.com/search?q=xsl-list+carlisle+mathml+++CDATA+entity
> may look vaguely familiar...
> 
> http://www.biglist.com/lists/xsl-list/archives/199901/msg00032.html
> 
> David

Current Thread