Philippe Coq wrote:
> I cannot succeed to process correctly   docBook documents with
> <xi:include> elements
> I have always XInclude error : could not load.. error
> I have seen that in the demo directory in XMLmind there is an example
> which is exactly
> what I want to do: /docbook-modular-book.xml./
> But here again when I try to process it via /xsltproc /processor I have
> errors.
> I haven't found in the doc where it is explain how to process examples
> of the demo directory.

Use "Convert Document" found in XXE Professional Edition (and also in
Evaluation Edition).



> Is there anyone that can explain how I can get the corresponding html
> file with /xltproc /? (or any other processors)?
> I have done something like this:
> xsltproc --xinclude -o /tmp/AA.html   /tmp/html.xsl    
> docbook-modular-book.xml

The first error message of xsltproc is very clear:
---
docbook-modular-book.xml:51: element include: XInclude error : detected
a recursion in docbook-modular-book.xml
---

After commenting out this, in docbook-modular-book.xml
---
      <xi:include href="" xmlns:xi="http://www.w3.org/2001/XInclude";
                  xpointer="limitation_list" />
---

I get more error messages:
---
warning: failed to load external entity "section1.xml"
docbook-modular-book.xml:62: element include: XInclude error : could not
load section1.xml, and no fallback was found
warning: failed to load external entity "section2.xml"
docbook-modular-book.xml:64: element include: XInclude error : could not
load section2.xml, and no fallback was found
warning: failed to load external entity "../docbook-modular-book.xml"
docbook-modular-book.xml:68: element include: XInclude error : could not
load ../docbook-modular-book.xml, and no fallback was found
---

This because section1.xml, section2.xml and ../docbook-modular-book.xml
are all included by docbook-modular-book/chapter.xml which itself has
been included by docbook-modular-book.xml by using a reference to an
external entity rather than by using XInclude.

After converting the reference to the chapter.xml external entity to an
XInclude, I still get this error message:

---
docbook-modular-book/chapter.xml:68: element include: XInclude error :
detected a recursion in docbook-modular-book.xml
---

After commenting out this in docbook-modular-book/chapter.xml
---
  <xi:include href="../docbook-modular-book.xml"
              xmlns:xi="http://www.w3.org/2001/XInclude";
              xpointer="limitations" />
---

I finally managed to run

---
xsltproc --xinclude -o /tmp/AA.html
../addon/config/docbook/xsl/html/docbook.xsl docbook-modular-book.xml
---

successfully!

Please find attached to this email an amended docbook-modular-book.xml
that works with xsltproc.



--> Conclusion #1: xsltproc has *two* *bugs*:
[1] Its detection of recursive inclusion is very naive and for this
reason, it detects two false recursions.

[2] When xsltproc finds in docbook-modular-book.xml

---
&__chapter__edx70kqy;
---

where:

---
<!ENTITY __chapter__edx70kqy SYSTEM "docbook-modular-book/chapter.xml">
---

and processes XIncludes inside chapter.xml, it forgets the base URL of
the referenced external entity.



--> If you intend to use xsltproc:

[1] Use Options|Options and check "Type of document reference"
"XInclude". See
http://www.xmlmind.com/xmleditor/_distrib/doc/help/com.xmlmind.xmleditapp.dialog.PreferencesEditorDialog.html#editOptions

[2] Never use "XXX (part of a modular document)" templates (for example,
don't use "Glossary (part of a modular document)" because these
templates have no <!DOCTYPE> and that xsltproc really needs a DTD to
process xpointer="XXX".
Instead create similar templates but having a <!DOCTYPE>.

[3] Don't use Xincludes which remotely look like being recursive.




--> Conclusion #2: Sorry for this mess which really is an XML, and hence
an XXE, killer.

On the bright side, there are no such problems with DocBook 5/RELAX
NG/xml:id.

We'll of course try to clean up this mess (to a certain extent) for next
release.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: docbook-modular-book.tar.gz
Type: application/x-tar
Size: 2746 bytes
Desc: not available
Url : 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20070115/65f63fc5/attachment.tar
 

Reply via email to