On 4/12/07, Jirka Kosek <jirka@kosek.cz> wrote:
> Martin Bryan wrote:
>
> > Not sure what James' rules are, but to me there is a clear priority between the three cases stated in the unlikely event that more than one of them occurred in a single document:
> >
> > 1) An explicit doctype declaration must take precedence over anything that is specified on the root element that follows it.
> > 2) Presuming that the PI precedes the root element then it must take precedence over anything specified in the root (but anywhere else it must be ignored because the root has already been parsed)
> > 3) Attributes on the root only take precedence if there is no previously identified schema definition.
>
> Why do you think it should work this way? Schema picked depends on
> validator you are using -- DTD validator will use !DOCTYPE, XSD
> validator will use xsi:schemaLocation and oXygen will use PI when asked
> for RELAX NG validation because there is no standardized way for
> associating schema with instance.
With respect to part 10, we have to define a consistent way to call
each validator component. I'm still unclear, if we need a polymorphic
validator or as you proposed a specific-by-language one.
How will you handle RelaxNG+Schematron or XMLSchema+Schematron ?
That's why I was asking for conditionnal validation
Anyway, we could hope to handle it by a choose in XProc
<p:choose>
<p:xpath-context>
<p:pipe step="previous" port="document"/>
</p:xpath-context>
<p:when test="/*/@xsi:schemaLocation or /*/@xsi:noNamespaceSchemaLocation">
<p:validate-xml-schema>
....
</p:validate-xml-schema>
</p:when>
<p:when test="/processing-instruction('oxygen')>
<p:choose>
<p:when text="start-with(/processing-instruction('oxygen'),
'RNGSchema=') and contains(/processing-instruction('oxygen'),
'type="compact"')">
<p:validate-relax-ng>
....
</p:validate-relax-ng>
</p:when>
:
:
</p:choose>
</p:when>
:
:
</p:choose>
But there is still at least two problems :
1) XPath 1.0 don't know if there is a <!DOCTYPE
2) For the moment, XProc doesn't define a Schematron Component,
Mohamed
-- Innovimax SARL Consulting, Training & XML Development 9, impasse des Orteaux 75020 Paris Tel : +33 8 72 475787 Fax : +33 1 4356 1746 http://www.innovimax.fr RCS Paris 488.018.631 SARL au capital de 10.000 € -- DSDL members discussion list To unsubscribe, please send a message with the command "unsubscribe" to dsdl-discuss-request@dsdl.org (mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)Received on Fri Apr 13 22:26:48 2007
This archive was generated by hypermail 2.1.8 : Sat Apr 14 2007 - 20:03:03 UTC