Next in thread → Next in month →

Re: [docbook-apps] Shared entity include file issues

From
<>
Date
2008-02-27T20:22:13+00:00
ID
Thread
Re: [docbook-apps] Shared entity include file issues
Bob, et al,

I am using SAXON 6.5.5 and a fairly standard catalog file - most of it came 
out of your book. What I am trying to do is to set up the tools and static files 
so that each documentation project can be run out of its own directory and 
reference the catalog and corporate ENTITY files that will exist in a 
separate directory.

 

The dir structure will look similar to this

 

<docroot>

     |- 
doctools

     |- 
documentation

         |- corp 
(static ENTITY files (*.mod))

         
|- project1

         
|- project2

 

 

This structure needs to work on Windows and Linux, so all of the tools are 
in doctools (saxon,fop,etc). However, the entity files are not being located 
correctly under Linux, using relative dirs. I have even tried static directory 
names (as below) but to no avail.

 

The error that I get is that SAXON is looking for the entity file in the 
"project" directory where the process is run from, but it is located in the 
"corp" dir.

 

I'm sure there is a better way of locating corporate static files, so I am 
open to suggestions. But I would still like to solve this catalog/entity 
issue.

 

 

Regards,

 

Dean Nelson

 

------- catalog file ----------

<!DOCTYPE catalog    PUBLIC "-//OASIS/DTD Entity 
Resolution XML Catalog V1.0//EN"
   "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd" 
[
   
  <!ENTITY 
XSL_VER          
"docbook-xsl-1.73.2">
  <!ENTITY 
DB_VER           
"docbook-xml-4.5">
  <!ENTITY 
MATHML_VER       "MathML2">
  
<!ENTITY BASE_DIR         
"../../">
  <!ENTITY CORP_MOD_DIR     "file:///root/doc/documentation/corp/">

 

]> 
   <!--  ENTITIES
   BASE_DIR = 
this is the base of the whole doc tree including 
doctools
                
Linux : "file:///root/doc/"
                
Win32 : "../../"
   <!ENTITY 
BASE_DIR         "file:///root/doc/">
   <!ENTITY 
BASE_DIR         
"../../">
                

    -->
   
<catalog prefer="public" 
xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">

 

    <group  xml:base="&BASE_DIR;"> <!-- 
configured above -->
    <!--  <group 
prefer="public" xml:base="file:///root/doc/"> 
--> <!-- UNIX/LINUX -->
    <!--  <group 
prefer="public" xml:base="../../"> 
-->            <!-- 
Windows -->
  
      
<system   systemId="met-xinclude.mod"   
uri="&CORP_MOD_DIR;/met-xinclude.mod"/>
      
<system   
systemId="met-defs.mod"       
uri="&CORP_MOD_DIR;/met-defs.mod"/>
       
<uri 
name="met-xinclude.mod"           
uri="&CORP_MOD_DIR;/met-xinclude.mod"/>    

 
      <public publicId="-//OASIS//DTD 
DocBook XML V4.4//EN" 
uri="doctools/&DB_VER;/docbookx.dtd"/>
      
<public publicId="-//W3C//DTD MathML 
2.0//EN"         
uri="doctools/MathML2/mathml2.dtd"/>

      <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.4/" 
rewritePrefix="doctools/&DB_VER;/"/>
      
<rewriteSystem systemIdStartString="http://www.docbook.org/xml/4.4/"            
rewritePrefix="doctools/&DB_VER;/"/>
      
<rewriteSystem systemIdStartString="http://www.docbook.org/xml/4.5/"            
rewritePrefix="doctools/&DB_VER;/"/>
      
<rewriteSystem systemIdStartString="http://www.w3.org/TR/MathML2/dtd/"          
rewritePrefix="doctools/&MATHML_VER;/"/>
        

        <!-- Resolve stylesheet URL to 
local file -->
      <rewriteURI 
uriStartString="http://docbook.sourceforge.net/release/xsl/current/"    
rewritePrefix="doctools/&XSL_VER;/"/>

    </group>

    <!-- Resolve DTD PUBLIC identifiers 
-->
    <nextCatalog 
catalog="doctools/&DB_VER;/catalog.xml"/>

 

</catalog>
----------------------------------

 

In a message dated 2/27/2008 10:58:26 A.M. Pacific Standard Time, 
 writes:

  
Hi,

  
A catalog entry can resolve an entity reference.  Can you describe 
  your catalog entries?

  
 

  
Have you tried using the catalog debugging feature of the parser?  
  What parser are you using?

  
 

  
Does the file still exist in the current directory?  If you are 
  using xsltproc, then if it finds it in the current directory, it will use that 
  and not bother with executing a catalog lookup.  I complained about this 
  "feature" to the developers of xsltproc, asking for at least an option to 
  force catalog retrieval, but I don't think it happened.

  
 

  
Bob Stayton
Sagehill Enterprises


  
 

  
 

  
    
----- Original Message ----- 

    
From: 
     

    
To:  
    

    
Sent: Monday, February 25, 2008 6:08 
    PM

    
Subject: [docbook-apps] Shared entity 
    include file issues

    

    
All,

    
 

    
I have an ENTITY in the DOCTYPE for my documents that references an 
    entity file that I include. However, I want to move that to central 
    directory so that it can be available for other docs as well. 

    
 

    
I would like to resolve it's location with a catalog file, but I am 
    having no luck adding it to my catalog file. The file is still looked for in 
    the current directory.

    
 

    
For example here is my source:

    
 

    
 

    
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book 
    PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.docbook.org/xml/4.4/docbookx.dtd"[
 <!ENTITY 
    % xinclude SYSTEM "met-xinclude.mod">
 <!ENTITY % met-defs 
    SYSTEM "met-defs.mod">
 %xinclude;
 %met-defs; 
    
]>

    
 

    
<book>
 <title>&DOC_TITLE;</title>
...

    
 

    
I would like to map the two mod files to a specific directory with a 
    catalog  file. I have looked at  Bob's section on "Using 
    an XML catalog to relocate dbgenent.mod" in

    
http://sagehill.net/docbookxsl/ModularEntities.html

    
 

    
But that kind of hides the info a bit plus it only works with one extra 
    include file, not two. It seems like a catalog should resolve an "ENTITY" 
    filename.

    
 

    
Can anyone help me out with this?

    
 

    
Thanks,

    
Dean Nelson

    
 

    

    
    Delicious ideas to please the pickiest eaters. Watch the video on AOL 
  Living.

Delicious ideas to please the pickiest eaters. Watch the video on AOL Living.
Next in thread → Next in month →