]> granicus.if.org Git - docbook-dsssl/commitdiff
fix problem with resourceref to another structure in assemblies snapshot-2018-12-07-01
authorbobstayton <bobs@sagehill.net>
Tue, 23 Oct 2018 21:21:31 +0000 (14:21 -0700)
committerbobstayton <bobs@sagehill.net>
Wed, 7 Nov 2018 22:20:50 +0000 (14:20 -0800)
xsl/assembly/assemble.xsl

index 7ee9a4a306fc207a88e1ea4ad7365497994759dc..65cf3b27d728f4b1906a3fa4afed500f85f0ebab 100644 (file)
    </xsl:copy>
 </xsl:template>
 
+<!-- process modules and structures encountered in resourceref content -->
+<xsl:template match="d:module" mode="copycontent">
+  <xsl:apply-templates select="."/>
+</xsl:template>
+  
+<xsl:template match="d:structure" mode="copycontent">
+  <xsl:apply-templates select="."/>
+</xsl:template>
+  
 <xsl:template match="processing-instruction('oxygen')"/>
 
 <!-- skip assembly info elements -->
     
     <xsl:otherwise>
       <xsl:variable name="ref.file.content" select="document($fileref,/)"/>
+        
     
       <!-- selects root or fragment depending on if $fragment is blank -->
-      <xsl:variable name="ref.content"
+      <xsl:variable name="ref.content.element"
         select="$ref.file.content/*[1][$fragment.id = ''] |
                 $ref.file.content/*[1][$fragment.id != '']/
                    descendant-or-self::*[@xml:id = $fragment.id]"/>
+      
+      
+      
+      <xsl:variable name="ref.content.nodes">
+        <xsl:apply-templates select="$ref.content.element" mode="ref.content.nodes"/>
+      </xsl:variable>
+      
+      <xsl:variable name="ref.content" select="exsl:node-set($ref.content.nodes)/*[1]"/>
         
       <xsl:if test="count($ref.content) = 0">
         <xsl:message terminate="yes">
           <xsl:text>' has no content or is unresolved.</xsl:text>
         </xsl:message>
       </xsl:if>
+      
+      <xsl:variable name="ref.name" select="local-name($ref.content)"/>
 
       <xsl:variable name="element.name">
         <xsl:apply-templates select="." mode="compute.element.name">
-          <xsl:with-param name="ref.name" select="local-name($ref.content)"/>
+          <xsl:with-param name="ref.name" select="$ref.name"/>
         </xsl:apply-templates>
       </xsl:variable>
 
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
-
-<xsl:template name="merge.info">
+  
+<!-- resolve resourceref reference to another structure into content -->  
+<xsl:template match="d:structure" mode="ref.content.nodes">
+  <xsl:apply-templates select="."/>
+</xsl:template>
+  
+<xsl:template match="*" mode="ref.content.nodes">
+  <xsl:copy-of select="."/>
+</xsl:template>
+  
+  <xsl:template name="merge.info">
   <xsl:param name="merge.element" select="NOTANODE"/>
   <xsl:param name="ref.content" select="NOTANODE"/>
   <xsl:param name="omittitles"/>