Hi Benjamin,

Catching up on email and noticed that I hadn't replied earlier.

I am using xpointer, though with xmllint rather than Xerces.

I had to define the namespace in the xpointer call (e.g., <xi:include 
href="ebook-intro.xml" 
xpointer="xmlns(d=http://docbook.org/ns/docbook)xpointer(/d:chapter/d:info/following-sibling::*))"/>)

I don't know if that is needed with Xerces, but it might be worth trying. 

Best regards,
Richard
-------
XML Press
XML for Technical Communicators
http://xmlpress.net
hamil...@xmlpress.net



On Aug 25, 2015, at 7:07, Kallauch, Benjamin (EEIN) 
<benjamin.kallau...@volkswagen.de> wrote:

> Hi Richard,
> 
> I've read your post and it looks like you're using the xpointer() scheme, 
> right? Unfortunately, my tool chain with Xalan and Xerces does not support 
> that scheme as described in the FAQ on the Xerces-Website by Apache. Rather 
> it says Xerces supports the element() scheme. But this seems at least not 
> fully functional: I encounter an XPointer error when using something like: 
> 
> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"; href="foo.xml" 
> xpointer="element(foo)"/>
> 
> 
> On the other hand, if I use a childsequence like the following, it works fine.
> 
> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"; href="foo.xml" 
> xpointer="element(/1/4)"/>
> 
> At the moment I have no need to include only parts of an xml with xinclude, 
> but in case I had to I would have a problem with my tool chain. Maybe you or 
> someone else have a solution for working with Xalan/Xerces and XPointer. (Or 
> maybe I have to switch to a more sophisticated XSLT processor / XML parser 
> combination some time.)
> 
> best regards
> Benjamin
> 
> -----Ursprüngliche Nachricht-----
> Von: Richard Hamilton [mailto:hamil...@xmlpress.net] 
> Gesendet: Freitag, 21. August 2015 22:09
> An: DocBook Apps
> Betreff: Re: [docbook-apps] <part> should become <appendix> in another book
> 
> I think that thread should get you headed in the right direction.
> 
> I still use the method I described in a post on that thread. Some might call 
> it inelegant, but it works for me:-). The only thing that I don't know about 
> is how to integrate it into an Ant script. I'm an old fogey who still uses 
> make for most builds (if it's not broken, don't fix it:-).
> 
> Dick Hamilton
> -------
> XML Press
> XML for Technical Communicators
> http://xmlpress.net
> hamil...@xmlpress.net
> 
> 
> 
> On Aug 19, 2015, at 6:31, Frank Arensmeier <farensme...@gmail.com> wrote:
> 
>> Just a quick heads-up. I just stumbled upon an old thread on this list 
>> dealing with more or less the same problem as you have.
>> 
>> http://comments.gmane.org/gmane.text.docbook.apps/29005
>> 
>> Maybe worth reading?
>> /frank 
>> 
>> 
>>> 19 aug 2015 kl. 15:20 skrev Lars Vogel <lars.vo...@gmail.com>:
>>> 
>>> Hi Frank,
>>> 
>>> thanks, xpointers sound very useful.
>>> 
>>> I tried it but my self-written xinclude Apache Ant task does not support 
>>> xpointers. Is anyone aware of an existing Ant xinclude task which has 
>>> support for xpointers?
>>> 
>>> Best regards, Lars
>>> 
>>> 2015-08-19 15:04 GMT+02:00 Frank Arensmeier <farensme...@gmail.com>:
>>> 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
>>> 
>>> 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"; 
>>>> href="820_gerrit.xml" />
>>>> </part>
>>>> 
>>>> or 
>>>> 
>>>> <appendix>
>>>>            <title>Gerrit code reviews with Eclipse</title>
>>>>            <xi:include xmlns:xi="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.
>>> 
>>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org

Reply via email to