Page 1 of 1

Pb in xi:include with xpointer

Posted: Sat Mar 12, 2005 11:00 pm
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

Posted: Tue Mar 15, 2005 4:06 pm
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

Solution?

Posted: Tue Mar 15, 2005 5:03 pm
by nsilberz
Thanks for the explanation. Do you have a solution?

Posted: Tue Mar 15, 2005 5:58 pm
by george
Hi,

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

Best Regards,
George

batch

Posted: Tue Mar 15, 2005 6:14 pm
by nsilberz
would it be possible to use another include mechanism?
may be using an external .bat file?

Posted: Tue Mar 15, 2005 6:46 pm
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

it works! but...

Posted: Tue Mar 15, 2005 7:03 pm
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?

Posted: Tue Mar 15, 2005 7:22 pm
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

Posted: Tue Mar 15, 2005 7:56 pm
by nsilberz
Could you give me all reasons why i should NOT always use Xsltproc instead of the non including Xerces?