Pb in xi:include with xpointer

Having trouble installing Oxygen? Got a bug to report? Post it all here.
nsilberz
Posts: 9
Joined: Tue Mar 01, 2005 12:15 pm

Pb in xi:include with xpointer

Post by nsilberz »

The following

o does not convert to Docbook PDF (makes an error
"page-sequence must be child of root, not fo:flow"),
o convert to DocBook HTML but the whole file is included.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.docbook.org/xml/4.3/docbookx.dtd"
[ <!ENTITY % xinclude SYSTEM "file:/E:\Dev\Projets\DocMaker\kaleidoc\app\xinclude.mod">
%xinclude;
]>
<book>
<title>Essai include</title>
<chapter>
<title>Introduction</title>

<para>Hello before</para>

<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href='temp2.xml' xpointer='myID' />

<para>Hello after</para>

</chapter>

</book>

temp2.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.docbook.org/xml/4.3/docbookx.dtd"
[ <!ENTITY % xinclude SYSTEM "file:/E:\Dev\Projets\DocMaker\kaleidoc\app\xinclude.mod">
%xinclude;
]>
<book>
<title>Essai include</title>
<chapter>
<title>Introduction</title>

<section id='myID'>
<title>KPage.removeOptionForAction()</title>
<para><emphasis role='bold'>C) removeOptionForAction(long action, Option* o)</emphasis></para>
<para><emphasis role='bold'>J) (not yet implemented)</emphasis></para>
<para>Removes the first association (action, option) found from the map. If the same (key, value) association is added more than once, only one of them will be removed.</para>

</section>
</chapter>

</book>


What is wrong with my files?

NiS
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

Oxygen uses Xerces XInclude implementation that does not support XPointer. Having the whole temp2.xml included then makes the FO stylesheets generate an invalid FO file thus the error.

Best Regards,
George
nsilberz
Posts: 9
Joined: Tue Mar 01, 2005 12:15 pm

Solution?

Post by nsilberz »

Thanks for the explanation. Do you have a solution?
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

You can move that section in a file and include that in both your files.

Best Regards,
George
nsilberz
Posts: 9
Joined: Tue Mar 01, 2005 12:15 pm

batch

Post by nsilberz »

would it be possible to use another include mechanism?
may be using an external .bat file?
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Looking more into this.... You can use the XInclude support of XSLTProc that has also XPointer support. You can just duplicate the standard DocBook PDF scenario and change the Transformer to Xsltproc and you should be able to get exactly what you need, the first document and only that section from the included document.

Best Regards,
George
nsilberz
Posts: 9
Joined: Tue Mar 01, 2005 12:15 pm

it works! but...

Post by nsilberz »

it works :-)_______)

but with some errors:

W Invalid URI: file:/E:\Dev\Projets\DocMaker\kaleidoc\app\xinclude.mod temp.xml file:///E%3A/Dev/Projets/DocMaker/kaleidoc/app/temp.xml 3:0
W file:///E%3A/Dev/Projets/DocMaker/kaleidoc/app/temp.xml:4: parser warning : PEReference: %xinclude; not found 0:0
W %xinclude; 0:0
W ^ 0:0
W Invalid URI: file:/E:\Dev\Projets\DocMaker\kaleidoc\app\xinclude.mod temp2.xml file:///E%3A/Dev/Projets/DocMaker/kaleidoc/app/temp2.xml 3:0
W file:///E%3A/Dev/Projets/DocMaker/kaleidoc/app/temp2.xml:4: parser warning : PEReference: %xinclude; not found 0:0
W %xinclude; 0:0
W ^ 0:0
W Making portrait pages on A4 paper (210mmx297mm) 0:0


any idea?
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

I guess you get the warnings because you are using \ and you should use / to specify the URI pointing to the xinclude.mod file. Probably that you will get them removed if you replace \ with /.

Best Regards,
George
nsilberz
Posts: 9
Joined: Tue Mar 01, 2005 12:15 pm

Post by nsilberz »

Could you give me all reasons why i should NOT always use Xsltproc instead of the non including Xerces?
Post Reply