OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Modular docbook with modular entities


<!-- LONG -->

Hi,

I am trying to build a book ( actually a FAQ yet the layout is done as
a book. Although I have been reading
http://www.sagehill.net/docbookxsl/ModularDoc.html and looking thru the
archieves of the mailing list, it does not work. Either I am missing the
obvious or I am doing something wrong.

Here is what I have done

1) Customized the DocBook DTD so XInclude and xml:base are included

<!-- This is the driver file for V1.0 of the SuSEFAQ DTD.
     Please use the following formal public identifier to identify it:

     "-//SUSEFAQ//DTD DocBook XML V4.2-Based Extension V1.0//EN"

  ............................................................. -->   
<!ENTITY % xinclude SYSTEM "xinclude.mod"> %xinclude;

<!ENTITY % DocBookDTD PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
                "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd";>
     %DocBookDTD; 

2. This is what I have in xinclude.mod

<!ELEMENT xi:include (xi:fallback?) >
<!ATTLIST xi:include
    xmlns:xi   CDATA       #FIXED    "http://www.w3.org/2001/XInclude";
    href       CDATA       #REQUIRED
    parse      (xml|text)  "xml"
    encoding   CDATA       #IMPLIED >

<!ELEMENT xi:fallback ANY>
<!ATTLIST xi:fallback
    xmlns:xi   CDATA   #FIXED   "http://www.w3.org/2001/XInclude"; >

<!ENTITY % local.chapter.class "| xi:include">
<!-- inside chapter or section elements -->
<!ENTITY % local.divcomponent.mix "| xi:include">
<!-- inside para, programlisting, literallayout, etc. -->   
<!ENTITY % local.para.char.mix "| xi:include">
<!-- inside bookinfo, chapterinfo, etc. -->      
<!ENTITY % local.info.class "| xi:include"> 
<!ENTITY % local.common.attrib  "xml:base  CDATA  #IMPLIED">

3. Created a catalog file 

<?xml version="1.0"?>
<!DOCTYPE catalog
   PUBLIC "-//OASIS/DTD Entity Resolution XML Catalog V1.0//EN"
   "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd";> 
<catalog  xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">  
  <group  prefer="public"
xml:base="file:///usr/local/share/sgml/susefaq/" >  

    <public 
       publicId="-//SUSEFAQ//DTD DocBook XML V4.2-Based Extension
V1.0//EN"
       uri="susefaq.dtd"/>
    <system
       systemId="susefaq.dtd"    
       uri="susefaq.dtd"/>
  </group>
</catalog>

Upto this point it works. Now here is what is causing headaches :-(


My actual document's layout is as follow

main-directory
    \_________dtd
    \_________xsl
     \________topic1-dir
      \_______topic2-dir
       \______chapters-dir
        \_____sections-dir
	 \____includes-dir


My initial idea was to keep <qandaentry> format files in their respective topic
directories, use them in <sect1> formated files placed in sections-dir
and then create <chapter> formated files in chapter directory. This way
I thought it was easy to expand the project and since the files are
small editing is also fast. (This is currently working with sgml yet I
now wnat to change to xml)

Finally in the main directory I was planning to have the Book format
file.

Hence my includes directory would basicly include the entity files which
would describe the files relationsship. (hello problem). If I put
everything in the "includes.ent" file it works. But when I want to have
the "includes.ent" to refer sections and chapters I can not make it
work.


<!-- $Id: includes.ent,v 1.6 2003/02/26 08:18:36 toganm Exp $ -->

<!-- DEFINE BASIC THINGS -->
<!ENTITY editor  "common/editor.xml">
<!ENTITY mail  "common/faq_maillist.xml">
<!ENTITY intro  "common/faq_abstract.xml">
<!ENTITY license  "common/fdl.txt">
<!ENTITY book_info  "common/book_info.xml">
<!ENTITY howthisisdone "common/howdone.xml">
<!ENTITY README.ISO   "common/README.iso-images.english">
<!ENTITY legalnotice  "common/legalnotice.txt">
<!ENTITY preface  "common/preface.xml">
<!ENTITY changes  "ChangeLog">
<!ENTITY reference  "common/index.xml">

<!-- DEFINE SECTIONS -->

<!ENTITY % sections_inc SYSTEM "sections.inc">%sections_inc;


<!-- DEFINE SECTION INCLUDES -->

<!ENTITY % section_include SYSTEM "section_includes.inc">%section_include;

<!-- DEFINE CHAPTERS -->

<!ENTITY % chapters_inc SYSTEM "chapters.inc">%chapters_inc;


<!-- $Id: common.inc,v 1.1.1.1 2002/02/16 10:40:21 toganm Exp $ -->

<!ENTITY common   "common/common.xml"> 
<!ENTITY common1   "common/common1.xml"> 

apache.inc

<!ENTITY apache  "apache/apache.xml">
<!ENTITY apache1  "apache/apache1.xml">
<!ENTITY apache2 "apache/apache2.xml">

sections.inc has
<!-- $Id: sections.inc,v 1.28 2004/01/24 21:17:48 toganm Exp $ -->
<!--Sect1 Includes -->

<!ENTITY sect_apache "sections/sect_apache.xml">
<!ENTITY sect_common "sections/sect_common.xml">


<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE book PUBLIC "-//SUSEFAQ//DTD DocBook XML V4.2-Based Extension
V1.0//EN"
   "/usr/local/share/sgml/susefaq/susefaq.dtd" [

<!ENTITY % files SYSTEM "includes.ent">%files;
                 ]>
<!-- $Id: faq_set.xml,v 1.7 2003/08/01 08:22:30 toganm Exp $ -->
<?psgml nofill screen programlisting literallayout?>
<book id="index">

!--<?dbhtml banner-href="stylesheet-images/SuSEbanner-1.png"?> -->

<xi:include href="&book_info;"
xmlns:xi="http://www.w2.org/2001/XInclude"/>
<xi:include href="&preface;"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
....
....
</book>

When I issue the "xmllint --noout --postvalid --xinclude faq.xml"
command it starts barking out and I can not validate the document

common/book_info.xml:21: error: Entity 'changes' not defined
<xi:include href="&changes;" xmlns:xi="http://www.w3.org/2001/XInclude";
parse="text">
                           ^
common/book_info.xml:26: error: Entity 'editor' not defined
<xi:include href="&editor;" xmlns:xi="http://www.w3.org/2001/XInclude"/>


Any ideas where I am doing wrong, or what I am doing wrong


-- 

Togan Muftuoglu



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]