[xsl] Stumped on XPath

Subject: [xsl] Stumped on XPath
From: Spencer Tickner <spencertickner@xxxxxxxxx>
Date: Tue, 7 Feb 2006 13:31:31 -0800
Hi everyone,

Thanks in advance for the help. I've got an interesting match pattern
(I think) I can't seem to get my mind around.

  <sentence>This is a sentence with a reference<id ref="1"/> as an
inline element</sentence>
     <clause>This is a clause with inline elements <strong>
and</strong> a reference <id ref="3"/></clause>
 <refnote id="1">This is the first reference</refnote>
 <refnote id="2">This is the second reference</refnote>
 <refnote id="3">This is the third reference</refnote>

Ok, I can't quite figure out the best method for comming up with the
following output

<p>This is a sentence with a reference (see Appendix A) as an inline
<p class="clause">This is a clause with inline elements <strong>
and</strong> a reference (see Appendix B)</p>

So far what I have is:

<xsl:template match="/">
<xsl:template match="manual">
<xsl:template match="sentence">
<xsl:template match="clause">
 <p class="clause"><xsl:apply-templates/></p>
<xsl:template match="strong">
<xsl:template match="appendix"/>
<xsl:template match="id">
<!-- This is what I'm having a hard time with -->
<!-- I imagine I have to match the id on the name and then count the
following siblings of appendix and use a translate to get the alpha
value,, but I can't seem to get the syntax down for this -->

Well there you go. It's a scaled down version, any thoughts would be
appreciated. Thanks.

Current Thread