klease 01/08/26 07:23:04 Modified: src/codegen font-file.xsl Log: Use the key function with the external charlist.xml file so no need for mergefile Revision Changes Path 1.9 +7 -5 xml-fop/src/codegen/font-file.xsl Index: font-file.xsl =================================================================== RCS file: /home/cvs/xml-fop/src/codegen/font-file.xsl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- font-file.xsl 2000/11/16 19:19:25 1.8 +++ font-file.xsl 2001/08/26 14:23:04 1.9 @@ -14,10 +14,10 @@ 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"/> <!--<redirect:write select="concat('org/apache/fop/render/pdf/fonts/', $class-name, '.java')">--> @@ -38,8 +38,10 @@ 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() { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]