Re: NVDL?

The schema type is determined from the namespace of the schema root 
element. There is also a schemaType attribute that should be used for 
non XML schemas, like Relax NG compact, for example in that case one can 
have

<validate schema="schema.rnc" 
schemaType="application/relax-ng-compact-syntax" />

Note however that as I mentioned in my initial reply the XSLT 
dispatching implementation has some known limitations - these can be 
removed but require some work that may be more difficult than 
implementing a p:nvdl step.

An argument in favor of implementing a p:nvdl step is that Schematron 
also has a dedicated step although it can be implemented (I believe a 
lot easier than NVDL) in XProc.

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

Henry S. Thompson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Assuming it's just a matter of pass/fail, then an XProc implementation
> of NVDL to handle the kind of example you offer is straightforward:
> 
>  <p:pipeline type="my:nvdl" xmlns:n="http://www.oxygenxml.com/nvdl"
> name="nvdl">
>  <p:viewport match="n:validate">
>   <p:load name="loadSchema">
>    <p:with-option name="href" select="@schema"/>
>   </p:load>
>   <p:choose>
>    <p:xpath-context>
>     <p:pipe step="nvdl" port="source"/>
>    </p:xpath-context>
>    <p:when test="string-ends(@href,'rng')">
>     <p:documentation><p>Is this <em>really</em> how choice of
> validator is done
> in NVDL?  Otherwise I can't guess. . .</p></p:documentation>
>     <p:validate-with-relax-ng>
>      <p:input port="source">
>       <p:pipe step="nvdl" port="source"/>
>      </p:input>
>      <p:input port="schema">
>       <p:pipe step="loadSchema" port="result"/>
>      </p:input>
>     </p:validate-with-relax-ng>
>    </p:when>
>    <p:when test="string-ends(@href,'xsd')">
>     <p:validate-with-xml-schema>
>      <p:input port="source">
>       <p:pipe step="nvdl" port="source"/>
>      </p:input>
>      <p:input port="schema">
>       <p:pipe step="loadSchema" port="result"/>
>      </p:input>
>     </p:validate-with-xml-schema>
>    </p:when>
>   </p:choose>
>  </p:viewport>
> </p:pipeline>
> 
> ht
> - -- 
>        Henry S. Thompson, School of Informatics, University of Edinburgh
>                          Half-time member of W3C Team
>       10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
>                 Fax: (44) 131 651-1426, e-mail: ht@inf.ed.ac.uk
>                        URL: http://www.ltg.ed.ac.uk/~ht/
> [mail really from me _always_ has this .sig -- mail without it is forged spam]
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.6 (GNU/Linux)
> 
> iD8DBQFI2/dckjnJixAXWBoRAjKYAJ0VTApbS5gtxWRCQGa6S2GuQi6LqwCfQchy
> nO9aKTo6SFmeGo4CijSLoxo=
> =/B5X
> -----END PGP SIGNATURE-----

Received on Friday, 26 September 2008 08:19:53 UTC