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] NVDL, DocBook, and MathML


Hi Bob,

Try adding an attach action on the MathML namespace. This will attach the content in MathML to the validation candidate triggered by the <validate schema="docbook.rng"/> action. Change the NVDL script as below:

<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"; startMode="docbook">
    <mode name="docbook">
        <namespace ns="http://docbook.org/ns/docbook";>
            <validate schema="docbook.rng"/>
        </namespace>
        <namespace ns="http://www.w3.org/1998/Math/MathML";>
            <attach/>
            <validate schema="../xsd/mathml3/mathml3.xsd"/>
        </namespace>
    </mode>
</rules>

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 09/02/16 02:33, Bob Stayton wrote:
I'm having a problem trying to process DocBook 5 documents using NVDL in
order to validate DocBook content that has MathML content within
equation or inlineequation.  The DocBook validation side is failing, but
only under NVDL.

The DocBook rng schema for inlineequation is as follows:

    <define name="db.inlineequation.content">
       <choice>
          <choice>
             <oneOrMore>
                <ref name="db.inlinemediaobject"/>
             </oneOrMore>
             <oneOrMore>
                <ref name="db.mathphrase"/>
             </oneOrMore>
          </choice>
          <oneOrMore>
             <ref name="db._any.mml"/>
          </oneOrMore>
       </choice>
    </define>

This schema specifies either a) inlinemediaobject or mathphrase, or b)
some MathML elements.  It *allows* MathML, but it does not validate it
against the MathML DTD.  NVDL is capable of doing that.  But ...

When I set up NVDL using a schema like this:

<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0";
startMode="docbook">
     <mode name="docbook">
         <namespace ns="http://docbook.org/ns/docbook";>
             <validate schema="docbook.rng"/>
         </namespace>
         <namespace ns="http://www.w3.org/1998/Math/MathML";>
             <validate schema="../xsd/mathml3/mathml3.xsd"/>
         </namespace>
     </mode>
</rules>

This DocBook content validates against docbook.rng:

<para><inlineequation>
   <math xmlns="http://www.w3.org/1998/Math/MathML";>
     ...
   </math>
</inlineequation></para>

But when processed with NVDL, it fails with this message:

Engine name: Jing
Severity: error
Description: element "inlineequation" incomplete; expected element
"alt", "inlinemediaobject" or "mathphrase" or an element from another
namespace

I think what is happening is that Jing has sent the <math> element to be
validated against the MathML schema, and then it sends the remains of
the inlineequation element to be validated against the DocBook schema.
But now inlineequation is empty, and fails validation.

I find if I insert an empty <mathphrase> inside inlineequation, then I
can work around this error.  Does anyone have any other ideas? That is,
short of customizing the docbook equation elements to allow them to be
empty.



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