aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaren Lease <klease@apache.org>2001-08-26 14:23:04 +0000
committerKaren Lease <klease@apache.org>2001-08-26 14:23:04 +0000
commit10288354fdd6ee5d4e83e7af380440b857c20b73 (patch)
tree5c02fd33d9e7947ac3eba78d4db5035b02841577 /src
parentef152715ba9651e78cad58d0652ec4cedd0c50a1 (diff)
downloadxmlgraphics-fop-10288354fdd6ee5d4e83e7af380440b857c20b73.tar.gz
xmlgraphics-fop-10288354fdd6ee5d4e83e7af380440b857c20b73.zip
Use the key function with the external charlist.xml file so no need for mergefile
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194442 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/codegen/font-file.xsl12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/codegen/font-file.xsl b/src/codegen/font-file.xsl
index 184b656e0..96a6f8583 100644
--- a/src/codegen/font-file.xsl
+++ b/src/codegen/font-file.xsl
@@ -14,9 +14,9 @@ file charlist.xml and extracts the WinAnsi code.
extension-element-prefixes="redirect">
<xsl:output method="text" />
-<!-- note that match in xsl:key doesn't like document('charlist.xml'), so the charlist
- must be merged with the source xml at build time by the Xslt task -->
-<xsl:key name="adobe-char-map" match="/font-metrics/font-mappings/map" use="@adobe-name"/>
+
+<!-- Note: this key is used with charlist.xml in a for-each. -->
+<xsl:key name="adobe-char-map" match="map" use="@adobe-name"/>
<xsl:template match="font-metrics">
<xsl:variable name="class-name" select="class-name"/>
@@ -38,8 +38,10 @@ public class <xsl:value-of select="class-name"/> extends Font {
static {
width = new int[256];
-<xsl:for-each select="widths/char"><xsl:variable name="char-name" select="@name"/><xsl:variable name="char-num" select="key('adobe-char-map',$char-name)/@win-ansi"/><xsl:if test="$char-num!='-1'"> width[<xsl:value-of select="$char-num"/>] = <xsl:value-of select="@width"/>;
-</xsl:if></xsl:for-each>
+<xsl:for-each select="widths/char"><xsl:variable name="char-name" select="@name"/><xsl:variable name="char-width" select="@width"/>
+<xsl:for-each select="document('charlist.xml')"><xsl:variable name="char-num" select="key('adobe-char-map',$char-name)/@win-ansi"/>
+<xsl:if test="$char-num!='-1'"> width[<xsl:value-of select="$char-num"/>] = <xsl:value-of select="$char-width"/>;
+</xsl:if></xsl:for-each></xsl:for-each>
}
public String encoding() {