You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Usorov, Evgeny" <EU...@kbv.de> on 2004/06/16 14:18:16 UTC
Xinclude gets Error-message if validating with Schema
Hallo
when using Schema which prooves the XML-File and Xincluded XML-File, the validation for second XML-File fails.
I implemented XIncludeParserConfiguration and without Schema-Check all is working.
With Schema-Check parser also recognize Errors in second XML-File, if I make them.
The Error-message is:
[Error] keytabs.xml:3:9: Document is invalid: no grammar found.
[Error] keytabs.xml:3:9: Document root element "keytabs", must match DOCTYPE root "null".
Here are 2 XML-Files and Schema-File:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--Sample XML file generated by XMLSPY v2004 rel. 3 U (http://www.xmlspy.com)-->
<test xmlns="mytest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2003/XInclude" xsi:schemaLocation="mytest test.xsd">
<document_type_cd V="String" S="String"/>
<xi:include href="keytabs.xml" parse="xml"/>
</test>
2-File:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--Sample XML file generated by XMLSPY v2004 rel. 3 U (http://www.xmlspy.com)-->
<keytabs xmlns="mytest" V="String" S="String"/>
Schema:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by XMLSPY 2004 Enterprise Ed. Release 3, Installed Multi + SMP for 2 users (KBV) -->
<xs:schema targetNamespace="mytest" xmlns="mytest" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ehdtl="urn:ehd/ehd/typelib/002" xmlns:keytabs="urn:ehd/001" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="test">
<xs:complexType>
<xs:sequence>
<xs:element ref="document_type_cd" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="keytabs" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="document_type_cd">
<xs:complexType>
<xs:attribute name="V" type="xs:string" use="required"/>
<xs:attribute name="S" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="keytabs">
<xs:complexType>
<xs:attribute name="V" type="xs:string" use="required"/>
<xs:attribute name="S" type="xs:string" use="required"/>
<xs:anyAttribute processContents="lax"/>
</xs:complexType>
</xs:element>
</xs:schema>
So is this a bug ? Or may be i should overwrite somehow the exception ?
Thanks in advance, Evgeny
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: Xinclude gets Error-message if validating with Schema
Posted by George Cristian Bina <ge...@sync.ro>.
> when using Schema which prooves the XML-File and Xincluded XML-File,
the validation for second XML-File fails.
> I implemented XIncludeParserConfiguration and without Schema-Check
all is working.
> With Schema-Check parser also recognize Errors in second XML-File, if
I make them.
[...]
> So is this a bug ? Or may be i should overwrite somehow the exception ?
See http://nagoya.apache.org/eyebrowse/ReadMsg?listId=85&msgNo=4191
Best Regards,
George
-----------------------------------------------
George Cristian Bina
<oXygen/> XML Editor & XSLT Editor/Debugger
http://www.oxygenxml.com
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org