[xsl] another xpath question

Subject: [xsl] another xpath question
From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 7 Jan 2002 15:52:44 -0000
I have another xpath question for you :)

If I have the following simplified XML snippet:

===
<xref xrefid="AA140110301W10AA" xidtype="TEXT"/>
<title>
  Renew LP Piston Seal (Fig 5.5.1
  <xref xrefid="F5.5.1" xidtype="FIGURE">) </xref>
</title>
===

and the following xsl templates:

<xsl:template match="xref">
(xref)
</xsl:template>

<xsl:template match="title">
  <xsl:value-of select="."/>
</xsl:template>

I get the following output:

(xref)
Renew LP Piston Seal (Fig 5.5.1)


It matches the first xref correctly, but not the second xref that is within
the <title> tags.  If I modify the title template to:

<xsl:template match="title">
  <xsl:value-of select="."/>
  <xsl:apply-templates/>
</xsl:template>

I get the output:

(xref)
Renew LP Piston Seal (Fig 5.5.1)
(xref)

Whereas the output I want is

(xref)
Renew LP Piston Seal (Fig 5.5.1(xref))   //the (xref) will be a graphic...

Why is it moving the (xref) outside of the (fig) brackets??  And, why will
it not match the inner <xref> without calling apply-templates?  I thought it
would look for a template match whenever it encountered a tag.

thanks in advance

andrew


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


Current Thread