Loading ...
Sorry, an error occurred while loading the content.
 

Adding XInclude to docbook in a local customization layer

Expand Messages
  • Steinar Bang
    Platform: Intel Pentium M, Ubuntu Dapper emacs21 21.4a-3ubuntu2 nxml-mode 20041004-5 When I used psgml to edit DocBook documents, I put the following the
    Message 1 of 5 , Dec 18, 2006
      Platform: Intel Pentium M, Ubuntu Dapper
      emacs21 21.4a-3ubuntu2
      nxml-mode 20041004-5

      When I used psgml to edit DocBook documents, I put the following the
      DOCTYPE declarations in the documents that use XInclude:

      <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML//EN"
      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
      <!ENTITY % docbook.xinclude.module
      PUBLIC "-//TTV/DocBook XInclude extension v1.0//EN" "dbxinclude.mod">

      %docbook.xinclude.module;
      ]>

      What I'm trying to figure out right now, is how to do the same thing
      with the debian/ubuntu nxml-mode, against the docbook rnc schemas it
      installs.

      Googling for "relax-ng customization layer" found some slides by Norm
      Walsh, showing something more or less like what I need to do:
      http://nwalsh.com/docs/tutorials/xml2005/slides/foil66.html

      However, what I don't know, is how to associate a wrapper schema with
      the documents? Do I add a schemas.xml locating file in the same
      directory as the document? In such a file, how do I override the
      existing locating rules for docbook documents (which presumably also
      will be loaded from a file in rng-schema-locating-files)?

      Thanx!


      - Steinar
    • Steinar Bang
      ... If I could replace this line, somehow to find the RNC wrapper schema/customization layer, I would be able to
      Message 2 of 5 , Dec 18, 2006
        >>>>> Steinar Bang <sb@...>:

        > However, what I don't know, is how to associate a wrapper schema
        > with the documents? Do I add a schemas.xml locating file in the
        > same directory as the document? In such a file, how do I override
        > the existing locating rules for docbook documents (which presumably
        > also will be loaded from a file in rng-schema-locating-files)?

        If I could replace this line, somehow
        <typeId id="DocBook" uri="docbook.rnc"/>
        to find the RNC wrapper schema/customization layer, I would be able to
        leverage the existing locating rules for docbook...
      • Steinar Bang
        ... Thanx to Dave Pawson s FAQ on the issue http://www.dpawson.co.uk/relaxng/nxml/schemaloc.html I ve now been able to make it look for the (not yet existing)
        Message 3 of 5 , Dec 18, 2006
          >>>>> Steinar Bang <sb@...>:

          >>>>> Steinar Bang <sb@...>:
          >> However, what I don't know, is how to associate a wrapper schema
          >> with the documents? Do I add a schemas.xml locating file in the
          >> same directory as the document? In such a file, how do I override
          >> the existing locating rules for docbook documents (which presumably
          >> also will be loaded from a file in rng-schema-locating-files)?

          > If I could replace this line, somehow
          > <typeId id="DocBook" uri="docbook.rnc"/>
          > to find the RNC wrapper schema/customization layer, I would be able to
          > leverage the existing locating rules for docbook...

          Thanx to Dave Pawson's FAQ on the issue
          http://www.dpawson.co.uk/relaxng/nxml/schemaloc.html
          I've now been able to make it look for the (not yet existing) schema
          file docbook_with_xinclude.rnc.

          What I did was:
          - Create a schemas.xml file in the document's directory:
          <?xml version="1.0"?>
          <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
          <include rules="../local_customization_layer/local_customization_rules.xml"/>
          </locatingRules>

          - Create a local_customizations_rules.xml file that looks like this:
          <?xml version="1.0"?>
          <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
          <typeId id="DocBook" uri="docbook_with_xinclude.rnc"/>
          </locatingRules>

          This is equivalent to what I've previously done for DTDs in psgml
          using catalog files.

          So now I just have to write my docbook_with_xinclude.rnc...
        • Chris Chiasson
          Are you using DocBook 4 or 5? With emacs+ DocBook 4, I edited the rnc file to allow xi:include in new places. With DocBook 5, NDW has included docbookxi.rnc,
          Message 4 of 5 , Dec 18, 2006
            Are you using DocBook 4 or 5? With emacs+ DocBook 4, I edited the rnc
            file to allow xi:include in new places. With DocBook 5, NDW has
            included docbookxi.rnc, which already allows xi:include.
          • Steinar Bang
            ... 4. ... That _is_ a possibility. But it feels like a cop-out, since I was able to use XInclude with the original DTD, without actually touching the DTD ...
            Message 5 of 5 , Dec 19, 2006
              >>>>> "Chris Chiasson" <chris@...>:

              > Are you using DocBook 4 or 5?

              4.

              > With emacs+ DocBook 4, I edited the rnc file to allow xi:include in
              > new places.

              That _is_ a possibility. But it feels like a cop-out, since I was
              able to use XInclude with the original DTD, without actually touching
              the DTD

              > With DocBook 5, NDW has included docbookxi.rnc, which already allows
              > xi:include.

              Yes, I know. Found it out when googling yesterday.

              Thanx!


              - Steinar
            Your message has been successfully submitted and would be delivered to recipients shortly.