This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

another xpath question



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]