OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] DocBook schema/DocBook XSL customization for teaching purposes

"Dimitry V. Ketov" <Dimitry.Ketov@avalon.ru> writes:


> Is there any consideration to extend docbook by adding new problem 
> orinented elements, such as  <course />, <module />, <topic />, <lab />, 
> <exercise />... Actually, I just want to reuse major docbook elements 
> (%divcomponent.mix) within new document structure ...
> or should I just "annotate" existing elements <book />, <article />, 
> <section /> by using role="..." attribute?

I personally would recommend adding new elements rather than using
the role attribute (or whatever other attribute). Especially if
you have other writers who will be authoring content using your
vocabulary. It would be much easier for writers to use <module/>
rather than to expect them to figure out that they need to use
<article role="module"/> (or however you would be mapping it if
you do it that way).

But if you decide to go with adding new elements, what you'll
probably want to do is to create an XSL stylesheet to take doc
instances with your custom elements and transform them into
"standard" DocBook before you generate any output from them. That
is, continue to keep your source files in your custom vocabulary,
then just generate standard DocBook from them when you need to
output to HTML or PDF or whatever.

Like this:

  1. custom vocab --custom XSL--> standard DocBook (temporary)

  2. standard DocBook (temporary) --standard DocBook XSL--> HTML/PDF/etc.

The reason to do it that way is that you then don't need to do any
hacking of the DocBook XSL stylesheets.

A custom-vocabulary-to-standard-DocBook XSL stylesheet is probably
going to be a lot easier to create and maintain than trying to
create XSLT templates for all your new elements.

And for creating the actual DocBook customization layer, I'd
recommend using the RELAX NG "compact syntax" (*.rnc) version[1]
of DocBook rather than the DTD.

  [1] http://docbook.org/rng/index.html

Once you've spent a little time getting familiar with RELAX NG
basics, I think you'll find it easier to create a customization
using that rather than using the DTD. And the RELAX NG "compact
syntax" is similar to DTD syntax. Except better.

Also, there are tools that allow you to automatically generate a
DTD from your RELAX NG schema. Or even a W3C XML Schema (XSD)
version if you need to. So you could keep your source schema in
RELAX NG form, and then just regenerate the DTD/XSD versions
whenever you make changes to your RNG source.


Michael Smith
http://logopoeia.com/ | http://www.oreillynet.com/pub/au/890


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]