I have some XSLT which is used to select text which has a particular keyword <sliceXML> This works fine and grabs each paragraph in turn. I also want to select the contents of the page tag <pg> and display it.
However it keeps selecting the value of the first <pg> tag and does not move onto the next. Any help is much appreciated.
My XML
<para>
<sliceXML>telescope</sliceXML>
A telescope test can be used to observe the night sky. What
observations can you make about the universe from your own back yard?
<pg>Page: 77</pg>
</para>
<para>
<sliceXML>telescope</sliceXML>
The scientists using the Sloan Digital Sky Survey telescope can
gather far more information than they can review quickly. Humans are
better at galaxy identification than computers. Why might this be a
difficult task for computers?
<pg>Page 78</pg>
</para>
NOTE: Page 77 and Page 78
My XSLT
<xsl:template name="para">
<div id="para">
<xsl:copy-of select="text()"/>
<span class="pagetag">
<xsl:value-of select="//pg"/><img src="images/arrows.png" height="12px"/>
</span>
</div>
</xsl:template>
My Current Results
A telescope test can be used to observe the night sky. What observations can you make about the universe from your own back yard? Page: 77
The scientists using the Sloan Digital Sky Survey telescope can gather far more information than they can review quickly. Humans are better at galaxy identification than computers. Why might this be a difficult task for computers? Page: 77
My Desired Results
A telescope test can be used to observe the night sky. What observations can you make about the universe from your own back yard? Page: 77
The scientists using the Sloan Digital Sky Survey telescope can gather far more information than they can review quickly. Humans are better at galaxy identification than computers. Why might this be a difficult task for computers? Page: 78
Thanks
Maybe you should try
pginstead of//pg? Because you want thepgthat is a child of yourpara.