I don't know anything about the actual validation features in BaseX, but as far as your XSD and XML documents are concerned, you appear to missing the prolog statement.

See here: http://www.w3.org/TR/2000/REC-xml-20001006#sec-prolog-dtd

Zach



On Tue, Nov 19, 2013 at 5:46 PM, Paul Fancher <fancherpaul@gmail.com> wrote:
I am trying to get a working schema validation, and I'm hitting a hangup:

Context:
db:open("Test","NewXMLSchema.xsd")
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.example.org/NewXMLSchema" targetNamespace="http://www.example.org/NewXMLSchema" elementFormDefault="qualified">
  <element name="test" type="tns:test"/>
  <complexType name="test">
    <sequence>
      <element name="item" type="string" maxOccurs="unbounded" minOccurs="1"/>
    </sequence>
  </complexType>
</schema>

db:open("Test","NewFile1.xml")
<tns:test xmlns:tns="http://www.example.org/NewXMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/NewXMLSchema NewXMLSchema.xsd ">
  <tns:item>Poke</tns:item>
  <tns:item>Poke</tns:item>
  <tns:item>Poke</tns:item>
</tns:test>

Test Code:
declare namespace tns = "http://www.example.org/NewXMLSchema";
validate:xsd-info("/tns:test", db:open("Test","NewXMLSchema.xsd"))

The error message I get back is
"Fatal: Content is not allowed in prolog."

Any ideas what's going on?


Paul

shoutout to the the people behind eclipse and the Eclipse XML Editors and Tools for some really awesome development software!

_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk