Hi,
I have tested your solution, it works fine. I still have a few interrogations.
1) XHTML
within <div> validation
For my XHTML part, I wanted to allow the same content as div element. That mean any content that might appear
within a div (text, span, div, table, ...).
According to the xhtml rng schema a div is defined by :
- Code: Select all
<define name="div">
<element name="div">
<ref name="div.attlist"/>
<ref name="Flow.model"/>
</element>
</define>
and Flow.model is defined by :
- Code: Select all
<define name="Flow.model">
<zeroOrMore>
<choice>
<text/>
<ref name="Inline.class"/>
<ref name="Block.class"/>
</choice>
</zeroOrMore>
</define>
In test.rng, I can't define "Flow.model" to be a "start" because :
- zeroOrMore is not a good model for a starting (oneOrore would be correct I guess)
- text neither
I then just tried this out for test.rng :
- Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<rng:grammar xmlns:rng="http://relaxng.org/ns/structure/1.0">
<rng:include href="http://www.w3.org/1999/xhtml/xhtml.rng">
<rng:start>
<rng:choice>
<rng:text/>
<rng:ref name="Block.class"/>
<rng:ref name="Inline.class"/>
</rng:choice>
</rng:start>
</rng:include>
</rng:grammar>
But this schema can't be validated, jing is complaining :
found element matching the prohibited path start//text in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
Text at this point is actually a problem : the only solution would be to allow it is part of "foo" grammar and should be allowed at the point where XHTML comes.
As a conclusion I would say : Text apparition can't make NVDL to change validation model because text is not "namespaced", and should always be considered as part of the "parent element" model in the validation process.
Daves pawson explains a similar case with validating "Atom" XML grammar in his tuto :
http://www.dpawson.co.uk/nvdl/validate.html.
"Atom chose to allow anything in the XHTML namespace within a div element".
2) XHTML schema
It's a more general question, but I find it hard to find XHTML schema for any version of the langage. I actually works with XHTML1.1.
- The RelaxNG schema provided with oXygen ([oxygen]/frameworks/xhtml/relaxng) seems to be for XHTML1.0, as explained in
http://www.thaiopensource.com/relaxng/xhtml. This schema is modularized and I've read that XHTML1.1 is a modularized version of XHTML1.0 (with a few differences ?)
- Looking at [oxygen]/frameworks/xhtml11, there is no Relax NG version of the schema.
- Do you know where I can find a XHTML1.1 RNG schema ?
- I thought about converting it from XSD with "Trang" but :
1) Trang doesn't take XSD as input (
http://www.thaiopensource.com/relaxng/trang.html)
Do you know any other reliable tools for such a conversion ?
2) which XSD input should I take :
- the one in
http://www.w3.org/TR/2004/WD-xhtml-modu ... zation.zip (xhtml11.xsd stipule v1.7)
- the one in
http://www.w3.org/TR/xhtml11/xhtml11.zip (xhtml11.xsd says v1.3)
It's sometimes hard to find out one way with schema and version's jungle
Any help, advices, related experiences would be appreciated.
Best Regards,
Matthieu.