Re: Keeping entities of source file (was:Testing the number of child elements)

Subject: Re: Keeping entities of source file (was:Testing the number of child elements)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 11 Feb 2000 11:24:19 GMT
> My source file contains <mo> elements   with content like &PlusMinus;

Your souce ___file____ contains  &PlusMinus; however _before_ it is seen
by XSL it is parsed by an XML parser which will replace every entity
reference by its definition.

So if you use the mathml dtd, your stylesheet can not tell whether your
source file had  &PlusMinus; or had character data, it produces the same
source tree.

> And I want this to go unchanged into the output file.

No you don't actually, for amaya you want character position 1234
(whatever it is)) to be output as &PlusMinus; however it was entered,
either as a character reference, or entity reference or as data.

It would be possible to use the string-replace recursion technique
discussed on this list earlier in the week, but to be honest it might be
simpler just to output character data from xsl and then just use perl to
back translate the characters to entity references. (Or try to get amaya
fixed not to need this)

> xsl:value-of disable-output-escaping="yes" select="."/>

xsl:text not xsl:value of

You might want to check th efaq and archives of this list wher ethis has
been discussed several times in the past.

David


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


Current Thread