[xsl] value-of select with two different namespaces

Subject: [xsl] value-of select with two different namespaces
From: Pierre MacKay <pierre.mackay@xxxxxxxxxxx>
Date: Sun, 13 Jul 2008 12:00:04 -0700
I need to extract the @fo:attributes in this node (from OOo-2.4 ODT). This is not yet 2.0, so I am using XSL 1.0.
I am using the very latest download of xsltproc and the associated libraries (downloaded three days ago):
The fo namespace is properly declared. (I do not see any error messages about that.)


This is one of many declarations I am trying to parse:

<style:style style:name="T126" style:family="text">
<style:text-properties fo:color="#000000" fo:font-size="10pt" fo:language="en" fo:country="US" fo:font-style="italic" fo:background-color="#00ffff" style:font-name-asian="Times New Roman" style:font-size-asian="10pt" style:language-asian="zxx" style:country-asian="none" style:font-style-asian="italic" style:font-name-complex="Times New Roman" style:font-size-complex="10pt" style:language-complex="zxx" style:country-complex="none"/>
</style:style>


I have the following named template:

<xsl:template match="style:text-properties" name="textfontprop">
<xsl:text> </xsl:text>
   <xsl:value-of select="@style:font-name"/>
<xsl:text> </xsl:text>
   <xsl:value-of select="@fo:color"/>
<xsl:text> </xsl:text>
   <xsl:value-of select="@fo:font-style"/>
<xsl:text> </xsl:text>
   <xsl:value-of select="@fo:font-variant"/>
<xsl:text> </xsl:text>
   <xsl:value-of select="@style:font-weight-complex"/>
<xsl:text> </xsl:text>
   <xsl:value-of select="@style:font-style-complex"/>
       <xsl:apply-templates/>
</xsl:template>

which is called by:

<xsl:template match="office:automatic-styles">
<xsl:text>
</xsl:text>
<xsl:for-each select="style:style"> <!-- This succeeds but reports nothing -->
<!-- It reports, correctly, that there is one child node -->
<!-- <xsl:text>% </xsl:text>
<xsl:value-of select="@style:family"/> returns value "text" -->
<xsl:text>% </xsl:text>
<xsl:value-of select="@style:name"/> <!-- Reliably returns the name -->
<!-- Now do the child text-properties node -->
<xsl:call-template name="textfontprop"/>
<xsl:text>
</xsl:text> </xsl:for-each> <!-- apply-templates is otiose here -->
</xsl:template>


I get the values of the @style:attributes, but the values of the @fo:attributes always come up as ' ' (empty).

What have I done wrong, and how can it be corrected?

Many thanks for any help.

Pierre MacKay

Current Thread