View Single Post
 
Old September 18th, 2009, 06:25 AM
Martin Honnen Martin Honnen is offline
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Here is an adapted stylesheet:
Code:
<xsl:stylesheet version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:strip-space elements="*"/>
  <xsl:output indent="yes"/>
  
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>
  
  <xsl:template match="doc/docid">
    <xsl:copy>
      <xsl:number count="doc"/>
    </xsl:copy>
  </xsl:template>
  
  <xsl:template match="REF">
    <xsl:copy>
      <xsl:apply-templates select="@* | L_TO_C"/>
      <xsl:if test="not(doc2c)">
        <xsl:apply-templates select="/Tremble/Dakota/doc" mode="m1"/>
      </xsl:if>
      <xsl:apply-templates select="r2p"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="doc" mode="m1">
    <doc2c>
      <xsl:apply-templates select="docid" mode="m1"/>
      <xsl:apply-templates select="/Tremble/Dakota/C/CID"/>
    </doc2c>
  </xsl:template>
  
  <xsl:template match="doc/docid" mode="m1">
    <xsl:copy>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
The Following User Says Thank You to Martin Honnen For This Useful Post:
fixit (September 23rd, 2009)