Hi there!

There is probably some XLST foo out there that does what you want. I’d like to 
suggest an other approach. Have a look at "Xpointers" for the x:include 
element. The attribute "xpointer" on that element defines an xpath expression 
(kind of) that is used to select only parts of the document you want to include.

http://www.sagehill.net/docbookxsl/ModularDoc.html#UsingXinclude 
<http://www.sagehill.net/docbookxsl/ModularDoc.html#UsingXinclude>

See e.g. "Selecting part of a file". However, your tool chain must support 
xpointers (not sure if xproc has suport for the full power of xpointers).

Hope this helps!

Regards
/frank 
 
> 19 aug 2015 kl. 14:21 skrev Lars Vogel <lars.vo...@gmail.com>:
> 
> Hi,
> 
> I use xinclude to include certain documents in different books. In a certain 
> context I want to use it as part in another as appendix.
> 
> I tried to remove the top level node with the following to my customization 
> layer:
> 
> <!-- Remove all sections marked with wrapper -->
>       <xsl:template match="part[@role='wrapper']" mode="profile">
>               <xsl:apply-templates select="part" mode="profile" />
>       </xsl:template>
> 
> And include it into the books like this:
> 
> <part>
>       <title>Gerrit code reviews with Eclipse</title>
>       <xi:include xmlns:xi="http://www.w3.org/2001/XInclude 
> <http://www.w3.org/2001/XInclude>" href="820_gerrit.xml" />
> </part>
> 
> or 
> 
> <appendix>
>               <title>Gerrit code reviews with Eclipse</title>
>               <xi:include xmlns:xi="http://www.w3.org/2001/XInclude 
> <http://www.w3.org/2001/XInclude>" href="820_gerrit.xml" />
> </appendix>
> 
> Unfortunately my customization removes not only the top level part element 
> but the whole part.
> 
> Is anyone aware of a nice trick to replace part in some books with appendix? 
> 
> Best regards, Lars
> 
> P.S. What I would like to have is the equivalent of the <merge> node for 
> defining Android layouts, this node is only their to have a valid XML file, 
> but is removed during the include process.




Reply via email to