Hi!

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. By the way, I also get a 
(correct) warning about duplicate IDs when when I open the book in XMLMind.

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. 

Now I am pretty sure that it's a common request to reuse content like I plan to 
do. 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 ...

Thanks a lot for your help!
Patrick
-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

Reply via email to