RE: [docbook-apps] Path resolution problem when using xi:include

From
Jeff Hooker <>
Date
2008-08-12T17:06:46+00:00
ID
[email protected]_nt.nt.pmc-sierra.bc.ca
Thread
RE: [docbook-apps] Path resolution problem when using xi:include
I'd suggest *defining* the parsing of the xinclude element 
rather than just going with the default. I'd start by parsing the xinclude as 
text (parse="text") and seeing if that prevents the parser from messing 
with the content. See  "4.2 Included Items when parse="xml" and 
 "4.3 Included Items when parse="text""  at http://www.w3.org/TR/xinclude/#processing

 

This could also easily be bad advice. I just kind of flail my way out of 
situations like this.

 

Jeff.

  
-----Original Message-----
From: Jean Christophe Kautzmann 
  [mailto:]
Sent: Monday, August 11, 2008 1:05 
  PM
To: 
Subject: 
  [docbook-apps] Path resolution problem when using 
  xi:include

  

  

  
Hi there, 

I use following versions:
- Docbook 5.0
- 
  saxon 6.5.*
- DocBook XSL stylesheets 1.72.0

I include in my 
  howto_website.xml (which is a chapter document) some code snippet from the 
  topnav.jsp file as follows:

<chapter status="draft" version="5.0" 
  xmlns="http://docbook.org/ns/docbook"
      
  xmlns:xlink="http://www.w3.org/1999/xlink"
      
  xmlns:xi="http://www.w3.org/2001/XInclude"
      
  xmlns:svg="http://www.w3.org/2000/svg"
      
  xmlns:mml="http://www.w3.org/1998/Math/MathML"
      
  xmlns:html="http://www.w3.org/1999/xhtml"
      
  xmlns:db="http://docbook.org/ns/docbook">
...
          
  <programlisting><textobject>
              
  <textdata 
  fileref="../../../checkout/topnav.jsp"></textdata>
            
  </textobject></programlisting>
...
</chapter>

When 
  I process howto_website.xml the generated pdf contains the code snippet from 
  topnav.jsp as expected.

Then I include howto_website.xml in 
  howto_all.xml (which is a book document) as follows:

<book 
  status="draft" version="5.0" xmlns="http://docbook.org/ns/docbook"
      
  xmlns:xlink="http://www.w3.org/1999/xlink"
      
  xmlns:xi="http://www.w3.org/2001/XInclude"
      
  xmlns:svg="http://www.w3.org/2000/svg"
      
  xmlns:mml="http://www.w3.org/1998/Math/MathML"
      
  xmlns:html="http://www.w3.org/1999/xhtml"
      
  xmlns:db="http://docbook.org/ns/docbook">
...
  
  <xi:include href="../howto_website/howto_website.xml" 
  />
</book>

My folder structure looks as 
  follows:
C:\SVNdocumentation\product\docs\checkout\topnav.jsp 
  
C:\SVNdocumentation\product\docs\src\docbook\howto_all\howto_all.xml
C:\SVNdocumentation\product\docs\src\docbook\howto_website\howto_website.xml

The 
  build is successful for this document but the generated pdf DOES NOT contain 
  the code snippet.
I get following message on the command line:
"Cannot 
  read file://C:/checkout/topnav.jsp"

Instead of resolving to 
  //C:/SVNdocumentation/product/docs/checkout/topnav.jsp, it resolves to 
  //C:/checkout/topnav.jsp which is an invalid path.

Can anybody help 
  me?

Thanks,
Jean-Christophe