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] xinclude


As Chris pointed out, the XInclude DTD fragment from my book is out of
date.  I posted an errata with the correct information:

http://www.sagehill.net/book-errata3rdEdition.html


Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Chris Chiasson" <chris@chiasson.name>
To: "docbook-apps List" <docbook-apps@lists.oasis-open.org>
Sent: Friday, March 03, 2006 12:25 PM
Subject: [docbook-apps] xinclude


Hello docbook-apps,

In trying to find an editor that would let me work on the
W3C-Schema-defined DotML format for drawing graphs with graphviz, I
decided to move away from XXE because its' free version doesn't
support XSD or RNG schemata if the document isn't one of a limited set
of XML formats. It also doesn't properly support xi:include elements
with the attribute parse="text".

I tried <oxygen/>, but found it slow, resource hungry, and confusing.
It once took upwards of five minutes to tell me I had ~20 xi:include
elements that were invalid. At least that's what I thought happened. I
haven't yet been back to it since trying emacs nxml mode. If you are
wondering, I did enable xi:include processing in <oxygen/>.

nXML... where to begin? It really assaults the (ok, my) mind to try to
assimilate a new schema XML format, a compact version thereof, and a
different philosophy about how (or even whether) a document is
associated with a schema.

An effective conversion to docbookxi 5+mathml schema and format, along
with proper stylesheet processing is still out of my reach... so, in
the meantime, I'm still with to db4+mathml.

At first, nXML was invalidating my xi:includes. I realized this is
because they are not in the included Docbook 4.2 grammar. I tried
adding xi:include and mml:math elements to the Docbook 4.5CR1 grammar
by paralleling the method given in the docbook 5 howto at

http://www.docbook.org/docs/howto/#faq-customization-mathml-svg

, where the example there is db5+mathml+svg. I didn't know how to
create a compact grammar for xincludes, so I found a DTD in the
mailing list archives,

http://lists.oasis-open.org/archives/docbook-apps/200210/msg00018.html

, and converted it with trang. Paralleling the howto did not work out for
me.

Since I had trang and the XInclude DTD of the archived message, I
decided to modify the Docbook 4.3 + MathML DTD from

http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd

and then convert it to a grammar. I had to modify the MathML DTD to
support XIncludes instead of adding the XInclude DTD via entity
reference to my documents, because nXML mode does not obey entity
references.

Since I don't know much about DTDs, this process was fun... heh... No
matter where I referenced the XInclude DTD inside the DB+MathML DTD,
nXML mode was still not validating properly.

Finally, as with many of my Docbook problems, I found an answer in the
place I should have looked first, Bob Stayton's Docbook XSL: The
Complete Guide at

http://www.sagehill.net/docbookxsl/ValidXinclude.html

. It says to append the xi:include element to the content models of
some other elements... this makes sense. I eventually figured out that
the content model modifications had to come before the main Docbook
DTD reference, which in turn had to come before the main XInclude DTD
reference in the (overall) DTD. (I don't know about the relative
positioning of the XInclude and MathML DTDs and entity references - my
.mml files and the .xml files that reference them are automatically
created by my Mathematica script, so I don't edit those files in
nXML.)

The (overall) DTD now looks like:

1. docbook mml entity mods

2. docbook xi entity mods (from
http://www.sagehill.net/docbookxsl/ValidXinclude.html, plus others)

3. docbook dtd reference

4. mathml dtd reference

5. xinclude dtd reference (from
http://lists.oasis-open.org/archives/docbook-apps/200210/msg00018.html)

I converted this DTD into a grammar and then loaded into nXML. As it
turned out, this didn't fix all my problems. Notice that the XInclude
DTD from msg00018.html above is missing the question mark from
(xi:fallback?). This made nXML mode tell me that an xi:include
couldn't be empty. I figured this question mark problem out for myself
by reading some DTD tutorials... Then I found the answer, again, in
the eample from Bob Stayton's book. I know... Not too bright am I...

So, that took care of allowing empty xi:includes. Unfortunately, nXML
mode didn't like my xpointer attributes. The third time being the
charm, started with Bob Stayton's DTD... his DTD was also missing the
xpointer attribute. ?!?!? Eventually, I just made one up. This last
bit caused my documents to validate. Yay!

Now. On to DotML.

P.S. I just found a good XInclude DTD at
http://www.w3.org/TR/xinclude/#include_element
P.P.S. I bet using rngconv on the XInclude XSD at the w3c page above
would generate a really good Relax NG grammar.

Ciao,
--
http://chris.chiasson.name/

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org






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