validate:rng compact
Monday, 21 September 2015 · 2 messages
AB
Andy Bunce21 Sep 2015 13:28 #
Is there an issue with compact RelaxNG compact validation where the schema is supplied as a xs:string, containing the resource in its string representation [1]?
let $rnc:="start = element book { page+ } page = element page { text }"
return validate:rng(<book><page/></book>,*$rnc*,true())Error:
[FODC0002] Resource .../start = element book { page+ } page = element page
{ text }' does not exist.If the schema is not XML It looks like it is always treating it as a file path.
/Andy
[1] http://docs.basex.org/wiki/Validation_Module#RelaxNG_Validation
CG
Christian Grün21 Sep 2015 15:30 #
Hi Andy,
Quoted text · Andy Bunce · 3 lines
> Is there an issue with compact RelaxNG compact validation where the schema > is supplied as a xs:string, containing the resource in its string > representation?
True, that's indeed inconsistent. And it's a bit tricky, because the second argument can be both a file path or the schema string, and I believe we have no easy way to find out what the supplied argument is supposed to be. For XSD and DTD, and for the input argument, things are easier, because XML always starts wirth an angle bracket.
In the latest snapshot [1], I am now interpreting the argument as file path. If the path cannot be successfully resolved, it is interpreted as schema string. It's not an ideal solution (better ideas are welcome), but at least the test should be unambiguous.
Thanks,
Christian
[1] http://files.basex.org/releases/latest/
Written for BaseX 8.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery