versorger at gmx.li wrote:
> 
> I'm having a hard time with xinclude: I have two files FOO and BAR, each 
> representing a docbook chapter. In chapter FOO I have a table that I would 
> like to refer to in chapter BAR. With XMLMind this is possible by adding an 
> id attribute to the table element. Now I can "copy as reference" the table 
> from FOO and paste the reference into BAR. So far so good and my chapter BAR 
> is a valid instance of docbook. 
> 
> The problem comes when I process the whole book where both chapters FOO and 
> BAR are referenced via xinclude: After I have resolved the includes with 
> xmllint I end up with an invalid instance of docbook due to the fact that the 
> table, along with its id attribute, is now present twice. 

Simply ignore this kind of duplicate ID errors. This kind of problem is
*intrinsic* to the use of XInclude with the element() scheme and there
is *nothing* that can be done.



> By the way, I also get a (correct) warning about duplicate IDs when when I 
> open the book in XMLMind.

As of v3.3, Options|Options, Tools|Validate section, checkbox "Filter
duplicate ID errors found in modular documents" allows to discard this
kind of duplicate ID errors (but not other duplicate ID errors).


> 
> After some reading on xinclude I came up with the following solution to use 
> in BAR: 
> 
> <table id="newID">
>   <xi:include href="FOO" xmlns:xi="http://www.w3.org/2001/XInclude";
>               xpointer="xpointer(id('someID')/*)" />
> </table>
> 
> I manually enter the table element and simply xinclude all child nodes, 
> leaving out the id attribute. xmllint will happily process this while XMLMind 
> chokes on the unsupported scheme for XPointer. 

* XInclude does not mandate supporting the xpointer() scheme, only the
element() scheme.

* Unlike the element() scheme, the xpointer() scheme is not yet a W3C
recommendation but only a working draft. See
http://www.w3.org/TR/xptr-xpointer/



> Now I am pretty sure that it's a common request to reuse content like I plan 
> to do. 

Sure, we do that all the time here at XMLmind. The main difference
between you and us is that we do not feel the need to double-check our
documents using xmllint.



> I am sure there is a nice and clean way to achieve this with both XMLMind and 
> any other tool and I was just not able to find it ...

Once again, simply *ignore* this kind of duplicate ID errors.


Reply via email to