← Prev in month ← Prev in thread

DOCBOOK-APPS: Re: I'm a little bit confused...

From
Norman Walsh <>
Date
2002-09-06T12:45:35+00:00
ID
Thread
DOCBOOK-APPS: Re: I'm a little bit confused...
/ Giuseppe Greco <> was heard to say:
| 1. When should I use PUBLIC identifiers
|    respectively SYSTEM identifiers?

In your documents, you should always use both. In catalogs, it may be
handy to map both. My catalog contains:

  <public publicId="-//OASIS//DTD DocBook XML V4.2//EN"
          uri="/share/doctypes/docbook42/xml/docbookx.dtd"/>

  <system systemId="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
          uri="/share/doctypes/docbook42/xml/docbookx.dtd"/>

| 2. When my document starts like this:
|
|    <?xml version='1.0'?>
|    <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|      "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|    <book>
|      ...
|    </book>
|
|    ... what happens if I use a catalog like this?
|
|    <!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="/usr/share/sgml/docbook/xml-dtd/">
|        "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
|         uri="docbookx.dtd"/>
|      </group>
|    </catalog>

That catalog isn't valid. You probably meant:

  <?xml version='1.0'?>
  <!DOCTYPE catalog "-//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="/usr/share/sgml/docbook/xml-dtd/">

    <public publicId="-//OASIS//DTD DocBook XML V4.2//EN"
            uri="docbookx.dtd"/>

    <system systemId="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
            uri="docbookx.dtd"/>
  </group>
  </catalog>

|    Does the XML processor look in the catalog for an entry identified by
|    "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN", and then, if
|    that entry doesn't exist, look at "http://www.oasis-open.org
|    /committees/entity/release/1.0/catalog.dtd"?

Since you've said prefer=public, the resolver begins by looking for a matching
public identifier. It finds one and therefor it resolves the DTD for your
document to "/usr/share/sgml/docbook/xml-dtd/docbookx.dtd".

Had you omitted the public identifier from the DocType declaration, it
would have found the matching system identifier and done the same
thing.

| 3. What the right way to proceed if I want to create my PUBLIC/SYSTEM
|    identifiers?

Create them for your own resources? Or create them in the catalog?
Or...I'm not sure what you're asking.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <>      | Vision is the art of seeing things
http://www.oasis-open.org/docbook/ | invisible.--Swift
Chair, DocBook Technical Committee |
← Prev in month ← Prev in thread