Maybe I'm confused about what you are trying to do. Shouldn't your test code line be:
validate:xsd-info(db:open("Test", "NewFile1.xml"), db:open("Test","NewXMLSchema.xsd"))
On Tue, Nov 19, 2013 at 6:16 PM, Paul Fancher <fancherpaul@gmail.com> wrote:
You are right; the prolog was removed during the import process. Any ideas what to do now? If nothing else, I could always convert the node() into a string and concatenate the prolog to the beginning, but I don't know if that would work for large XML files or not...
PaulOn Tue, Nov 19, 2013 at 4:54 PM, Zachary DeLuca <zadeluca@gmail.com> wrote:
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
ZachOn 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?Paulshoutout 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
_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk