logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Docbook customization: msg#00002

Subject: Re: Docbook customization

On Apr 27, 2005, at 6:02 AM, Stephane Bortzmeyer wrote:

> Can I customize the RelaxNG schema? Or should I go on with the DTD and 
> use
> trang to translate to a RelaxNG file?

Yes, you can customize a RNG schema; big time!  Particularly if it's 
designed to be customized.

Here's my own example:

# customization for scholarly writing
namespace db = “http://docbook.org/docbook-ng”;
namespace mods = “http://www.loc.gov/mods/v3″;
default namespace = “http://docbook.org/docbook-ng”;

include “mods-3-0.rnc”
{
   extensionSchema = db._any
}

include “docbook-ng.rnc” {
db.any = element * - (db:*|mods:*) { db.any.attribute, (text, db._any) }

# remove all the main software/technology related definitions
         db.domain.inlines = notAllowed
         db.product.inlines = notAllowed
         db.technical.blocks = notAllowed
         db.verbatim.blocks = notAllowed
         db.synopsis.blocks = notAllowed
# add a new element to quote
         db.quote = element quote { db.quote.attlist, (db.all.inlines | 
hb.nonquote)* }
# add mods to bibliography element (DocBook's bib model isn't good 
enough)
         db.bibliography = element bibliography {
                 db.bibliography.attlist,
                 db.bibliography.info,
                 db.all.blocks*,
                 (db.bibliodiv+ | (ModsSchema | db.biblioentry | 
db.bibliomixed)+)
                 }
}

# nonquote pattern allows for semantic rendering of split quotes
like: # “The world,” the guy said, “is flat.”
         hb.nonquote = element nq { empty }


Bruce



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/

<*> To unsubscribe from this group, send an email to:
    emacs-nxml-mode-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 






<Prev in Thread] Current Thread [Next in Thread>