Issue with last night's snapshot
Wednesday, 27 July 2016 · 3 messages
FB
France Baril27 Jul 2016 01:05 #
I can't seem to validate content (It says the .xsd file does not exist). Here is some test code:
let $xsd :=
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="root">
<xs:complexType mixed="false">
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="leaf"><xs:complexType><xs:attribute
name="value" type="xs:string"></xs:attribute></xs:complexType></xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
let $xml :=
<root><leaf value="test"></leaf></root>
let $xsd-path := 'xsd-test.xsd'
let $xsd-file := file:write($xsd-path, $xsd)return
validate:xsd-info($xml, $xsd-path)--
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
CG
Christian Grün27 Jul 2016 01:17 #
Hi France,
the example works for me (it returns nothing, as I would have expected). Maybe you’ll need to work with absolute paths, or with
file:base-dir() or file:current-dir()?
ChristianQuoted text · France Baril · 31 lines
On Tue, Jul 26, 2016 at 11:04 PM, France Baril <france.baril at architextus.com> wrote: > I can't seem to validate content (It says the .xsd file does not exist). > Here is some test code: > > let $xsd := > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > elementFormDefault="qualified"> > <xs:element name="root"> > <xs:complexType mixed="false"> > <xs:choice minOccurs="1" maxOccurs="unbounded"> > <xs:element name="leaf"><xs:complexType><xs:attribute > name="value" type="xs:string"></xs:attribute></xs:complexType></xs:element> > </xs:choice> > </xs:complexType> > </xs:element> > </xs:schema> > > let $xml := > <root><leaf value="test"></leaf></root> > > let $xsd-path := 'xsd-test.xsd' > let $xsd-file := file:write($xsd-path, $xsd) > > > return validate:xsd-info($xml, $xsd-path) > > -- > France Baril > Architecte documentaire / Documentation architect > france.baril at architextus.com
FB
France Baril27 Jul 2016 04:17 #
Ok,
file:current-dir() on the validation did the trick. I assumed that file:write and xsd:validate-info would default to the same location as they used to. Assumptions are a killer!Written for BaseX 8.5. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery