Philippe Nobili wrote:
> We need to use Olinking technique to link between several DocBook XML
> files. These are the two issues we currently face:
> 
> *1) Editing the target database file*
> 
> The DTD of this file is somewhere in
> docbook/xsl/common/targetdatabase.dtd. What we would like to do is to
> create/edit  target database XML documents like  any other DocBook
> document types.
> 
> The only way we found is the following:
> 
> A) Modify the addon/config/catalog.xml file to declarer the DTD and
> assigns an identifier to it, e.g.:
> 
>   <!-- Target Database -->
>   <public publicId="-//OASIS//DTD DocBook XML Tools//EN"
>           uri="docbook/xsl/common/targetdatabase.dtd"/>
> 
> The uri points to the right location, but
> 1) We have invented a public Id, are they rules to follow in this respect ?

No. However it's better to avoid using the substring "DTD DocBook" to
avoid conflicts with XXE's configuration detection rules. See below.




> 2) More ennoying, we have to modify XMLmind distribution. Is there a way
> to make this declaration in our customization layers ?
> 
> B) Declare a new template using this identifier and containing an empty
> target database document. This is OK, providing that the ID declared
> above looks OK.

targetdatabase.dtd is unlikely to change. I recommend to copy this file
to the directory containing your XXE configuration for target databases.

I've created such configuration for you to give you a quick start.
Please find targetdatabase_config.tar.gz attached  to this document.




> 
> *2) Creating the target.db file*
> 
> When *collect.xref.targets* is set to *yes* in the conversion
> parameters, no target file is generated. We currenlty have to run
> xsltproc manually to create one...
> 
> If *collect.xref.targets* is set to *only,* then FOP gives an exception
> and complains that the FO file is empty (I guess this is normal since
> only targets are collected...). The problem is that intermediate FO
> files are cleaned-up and nothing is generated.
> 
> Did we miss something ?

This question is unrelated to XMLmind XML Editor. Please refer to
DocBook XSL: The Complete Guide by Bob Stayton --
http://www.sagehill.net/docbookxsl/



Here at XMLmind, we olinks our documents (which is a pretty difficult
task) and we use this kind of makefiles to do it.

---
all:: html pdf

html:
        convertdoc -p callout.graphics 1 \
                -p toc.section.depth 4 \
                -p chunk.section.depth 2 \
                -p use.id.as.filename 1 \
                -p olink.doctitle yes \
                -p current.docid configure \
                -pu target.database.document ../common/doc_html.sitemap \
                docb.toHTML doc.xml -u $(DOC_DIR)
        cp -r samples $(DOC_DIR)

pdf:
        convertdoc -t ../common/fo_docbook.xsl \
                -p callout.graphics 0 \
                -p toc.section.depth 4 \
                -p variablelist.as.blocks 1 \
                -p insert.link.page.number yes \
                -p insert.xref.page.number yes \
                -p olink.doctitle yes \
                -p insert.olink.pdf.frag 1 \
                -p current.docid configure \
                -pu target.database.document ../common/doc_pdf.sitemap \
            docb.toPSFile doc.xml \
            -s pdf -s "|pdf" -s "/book toc" -s 1 -u $(DOC_DIR)/configure.pdf

targets:
        convertdoc -p callout.graphics 1 \
                -p toc.section.depth 4 \
                -p chunk.section.depth 2 \
                -p use.id.as.filename 1 \
                -p collect.xref.targets only \
                docb.toHTML doc.xml -u $(DOC_DIR)
        mv ./target.db ../common/configure_html.targets
#
        -convertdoc -p collect.xref.targets only \
            docb.toPSFile doc.xml \
            -s pdf -s "|pdf" -s "/book toc" -s 1 -u $(DOC_DIR)/configure.pdf
        mv ./target.db ../common/configure_pdf.targets
---

* Each document is contained in a separate directory and has its own
makefile.

* First pass: "make targets" for all our documents. Second pass: "make
html pdf" for all our documents.

* Note that "convertdoc -p collect.xref.targets only docb.toPSFile..."
is expected to fail, but that's not a problem because target.db has been
successfully generated.

* Our .sitemap files, created by hand using a text editor, look like this:
---
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE targetset
  SYSTEM "../../addon/config/docbook/xsl/common/targetdatabase.dtd" [
  <!ENTITY xhtml SYSTEM "xhtml_html.targets">
  <!ENTITY docbook SYSTEM "docbook_html.targets">
  <!ENTITY commands SYSTEM "commands_html.targets">
  <!ENTITY configure SYSTEM "configure_html.targets">
  <!ENTITY dev SYSTEM "dev_html.targets">
  <!ENTITY help SYSTEM "help_html.targets">
  <!ENTITY gui SYSTEM "gui_html.targets">
  <!ENTITY csssupport SYSTEM "csssupport_html.targets">
  <!ENTITY spreadsheet SYSTEM "spreadsheet_html.targets">
  <!ENTITY user SYSTEM "user_html.targets">
]>
<targetset>
  <sitemap>
    <dir name="doc">

      <dir name="xhtml">
        <document targetdoc="xhtml">
          &xhtml;
        </document>
      </dir>

      <dir name="docbook">
        <document targetdoc="docbook">
          &docbook;
        </document>
      </dir>

      <dir name="commands">
        <document targetdoc="commands">
          &commands;
        </document>
      </dir>

      <dir name="configure">
        <document targetdoc="configure">
          &configure;
        </document>
      </dir>
      ...
    </dir>
  </sitemap>
</targetset>
---

* Note that we don't use xsltproc (an excellent tool) but Saxon and that
we don't use FOP 1.x (a decent tool; will take a couple of years before
becoming excellent) but RenderX XEP.

You can download the full source of XMLmind XML Editor documentation
from http://www.xmlmind.net/xmleditor/_download/xxe-docsrc-4_4_0.tar.gz

Hope this helps.










-------------- next part --------------
A non-text attachment was scrubbed...
Name: targetdatabase_config.tar.gz
Type: application/x-gzip
Size: 924 bytes
Desc: not available
Url : 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20090813/f6952c13/attachment.gz
 

Reply via email to