Commits

btingle  committed ec03e76

works to c12 depth

  • Participants
  • Parent commits ba8e92f

Comments (0)

Files changed (2)

File dao-test.xml

+<c08>
+  <did>HEY</did>
+  <dao href="http://example.org/"><daodesc><p>YOU</p></daodesc></dao>
+  <c09>
+    <did>HEY</did>
+    <dao href="http://example.org/"><daodesc><p>YOU</p></daodesc></dao>
+    <dao href="http://example.org/"><daodesc><p>YOU</p></daodesc></dao>
+    <dao href="http://example.org/"><daodesc><p>YOU</p></daodesc></dao>
+    <dao href="http://example.org/"><daodesc><p>YOU</p></daodesc></dao>
+    <c10>
+      <did>HEY</did>
+      <dao href="http://example.org/"><daodesc><p>YOU</p></daodesc></dao>
+      <dao href="http://example.org/"><daodesc><p>YOU</p></daodesc></dao>
+      <dao href="http://example.org/"><daodesc><p>YOU</p></daodesc></dao>
+      <dao href="http://example.org/"><daodesc><p>YOU</p></daodesc></dao>
+      <dao href="http://example.org/"><daodesc><p>YOU</p></daodesc></dao>
+    </c10>
+  </c09>
+</c08>
     </xsl:copy>
   </xsl:template>
 
-  <xsl:template match="dao[not(parent::did)]">
+  <xsl:template match="dao[not(parent::did) and not(parent::archdesc)]">
     <xsl:variable name="plusone">
       <xsl:value-of select="number(substring(name(..),2,2))+1"/>
     </xsl:variable>
-    <xsl:element name="c0{$plusone}">
+    <xsl:variable name="cD">
+      <xsl:choose>
+        <xsl:when test="$plusone &lt; 10">
+          <xsl:text>c0</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>c1</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <!-- xsl:element name="{ if ( $pluseone &lt; 10 ) then ('c0') else ('c1')}{$plusone}" -->
+    <xsl:element name="{$cD}{number($plusone) mod 10}">
       <did>
         <unittitle><xsl:value-of select="daodesc/p"/></unittitle>
         <dao href="{@href}"/>