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


BTW, the (overall) DTD I came up with didn't work when referencing the
Docbook 4.5CR1 DTD. It only worked when referencing the Docbook 4.3
DTD. I wonder why that is?

Here is the text of the DTD:

<!ENTITY % mathml-colon               ':'>
<!ENTITY % mathml-prefix              'mml'>
<!ENTITY % mathml-math                '%mathml-prefix;%mathml-colon;math' >
<!ENTITY % equation.content "(alt?, (graphic|mediaobject|%mathml-math;)+)">
<!ENTITY % inlineequation.content "(alt?,
(graphic|inlinemediaobject|%mathml-math;)+)">

<!ENTITY % local.chapter.class "| xi:include">
<!ENTITY % local.divcomponent.mix "| xi:include">
<!ENTITY % local.para.char.mix "| xi:include">
<!ENTITY % local.info.class "| xi:include">
<!ENTITY % local.component.mix "| xi:include">

<!ENTITY % docbook PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
                   "../../xml-dtd-4.3/docbookx.dtd">
%docbook;

<!ENTITY % NS.prefixed     "INCLUDE">
<!ENTITY % MATHML.prefix   "%mathml-prefix;">
<!ENTITY % NamespaceDecl.attrib "
	xmlns%mathml-colon;%mathml-prefix;
		CDATA	#FIXED 'http://www.w3.org/1998/Math/MathML'">

<!ENTITY % mathml PUBLIC "-//W3C//DTD MathML 2.0//EN"
                  "../../../common/dtd/mathml2/mathml2.dtd">
%mathml;

<!ENTITY % xinclude PUBLIC "-//UBS//CORE//DTD XInclude V1.0//EN"
                    "../../../xinclude/xinclude.dtd">
%xinclude;


On 3/3/06, Chris Chiasson <chris@chiasson.name> wrote:
> 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/
>


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


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