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

969Re: Docbook customization

Expand Messages
  • Stephane Bortzmeyer
    Apr 27, 2005
    • 0 Attachment
      On Wed, Apr 27, 2005 at 12:27:26PM +0200,
      Vincent Lefevre <vincent@...> wrote
      a message of 28 lines which said:

      > Yes, this is what I do. For instance, to add an attribute:

      OK, many thanks, it works for me. And I prefer to edit RNC than DTD,
      anyway. For the record and the archives, here is the complete
      solution. I do not master locatingRules yet, so sorry for the absolute

      Local schema:

      % cat afnic-docbook.rnc
      include "/usr/share/emacs/site-lisp/nxml-mode/schema/docbook.rnc"

      local.common.attrib |= attribute osversionequal { text }

      rfc = element rfc { attlist.rfc, empty }
      attlist.rfc &= attribute num { text }?

      local.para.char.mix |= rfc

      Docbook conforming document, made with nxml:

      % cat mydoc.db
      <?xml version="1.0" encoding="utf-8"?>
      <para osversionequal="1">Very short <rfc num="1"/></para>

      Makefile to process, produce the RNG (required by libxml2's xmllint),

      % cat Makefile
      all: test

      %.rng: %.rnc
      trang -I rnc -O rng $< $@

      test: afnic-docbook.rng mydoc.db
      xmllint --relaxng afnic-docbook.rng --noout ./mydoc.db
    • Show all 4 messages in this topic