[xsl] storing translatable text outside stylesheets

Subject: [xsl] storing translatable text outside stylesheets
From: Linda van den Brink <lvdbrink@xxxxxxx>
Date: Mon, 18 Jun 2001 12:47:23 +0200
Hi all, 

I have a set of stylesheets to be used to convert XML to HTML. These
stylesheets contain text strings that must be translated. I prefer to use an
external file with entities for this purpose, because I use entities for
translatable often-used text in other parts of my XML system as well, and
because entity references are so compact (I just ... well, like them).

However, when I add this reference to the entity file to the top of my
stylesheet: 
<!DOCTYPE xsl:stylesheet [
<!ENTITY % stylesheettext SYSTEM "stylesheettext.ent"> ]>

And then use entity references like this in the stylesheet, the entities
symbol and desc having been declared in the entity file: 
<xsl:template match="FigLegend">
	<table><tr><th>&symbol;</th><th>&desc;</th></tr>
	<tr><td><xsl:value-of select="LegendEntry/Symbol"/></td>
	<td><xsl:value-of select="LegendEntry/Desc"/></td></tr></table>
</xsl:template>

Saxon (with its default parser) gives an error: 
  org.xml.sax.SAXParseException: reference to undeclared entity (found
"symbol")
: reference to undeclared entity (found "symbol")

When I declare the entities in the internal DTD subset, e.g. 
<!DOCTYPE xsl:stylesheet [
<!ENTITY symbol "Symbol"> ]>

then it does work. So it seems like Saxon isn't reading the external entity.
Am I doing something wrong, or does Saxon (Aelfred) not support this? 

Linda

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


Current Thread