none
wordProcessingML and xpath RRS feed

  • Question

  • hi,

     

    i have a wordProcessingML file with some custom tags.

    in this xml file i added a tag that enclose all of the xml of a page in the word document, all of the other tags are exactly the same as before.

     

    i use xsl to display the xml file as html, the problem i have is with the footnotes..

    since i'm dividing the document to pages i want each page to show only its footnotes, that not a problem but when i try to add the reference numbers to the footnotes everything goes wrong...

     

    the closest i managed to get was achived by the next code:

    Code Block

    <xsl:template match="w:t">
      <span>
       <xsl:apply-templates select="../w:rPr" />
       <xsl:value-of select="." />
       <xsl:if test="../following-sibling::w:r/w:footnote">
        <a class="footnoteLink">
         <xsl:attribute name="href">#</xsl:attribute>
         <xsl:attribute name="id">footnoteLink<xsl:number count="//w:r/w:footnote" from="//w:body" level="any" /></xsl:attribute>
         <xsl:attribute name="onclick">gotoNote(<xsl:number count="//w:r/w:footnote" from="//w:body" level="any" />); return false;</xsl:attribute>
         <xsl:number count="//w:r/w:footnote" from="//w:body/blstr:page" level="single" />
         <xsl:value-of select="count(../../preceding-sibling::w:p//w:footnote) + 1" />
        </a>
       </xsl:if>
      </span>
     </xsl:template>

     

    but this doesnt work well at all, in some pages it's ok but in other pages i get "1" more than once...

     

    any ideas how i can count the footnotes of the same page?

    thanks, nitzan.

    Monday, October 22, 2007 12:35 PM