Re: xerces-j validation issues

> What is this problem?
>
> Here is the doc set (which XSV thinks is fine):
>
> XML IS:
> -----------
> <htmlEditor
>   xmlns="http://www.emilygraham.com/java/other/Editor"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://www.emilygraham.com/java/other/Editor
>   http://www.emilygraham.com/java/other/editor.xsd">
>
>   <updateTime></updateTime>
>   <fields>
>     <field columnName="nickname">
>       <shortDesc>Short Desc</shortDesc>
>       <htmlType name="select">
>         <name>firstName</name>
>         <value>lastName</value>
>       </htmlType>
>       <allowNull>adfsa</allowNull>
>       <defaultVal>Blueberry</defaultVal>
>     </field>
>   </fields>
> </htmlEditor>

Apart from the fact that <updateTime> doesn't have a valid dateTime and that
"adfsa" isn't a valid boolean for element <allowNull> it all seems fine to me
(XSV wouldn't catch this because simpleType checking isn't implemented yet).
What version of Xerces are you using?
I just tried it with Xercex 2 beta and it validated fine.

Cheers,
/Eddie

>
> ----------
> XSD IS:
> ----------
> <schema targetNamespace="http://www.emilygraham.com/java/other/Editor"
>         xmlns="http://www.w3.org/2001/XMLSchema"
>         xmlns:e="http://www.emilygraham.com/java/other/Editor"
>         elementFormDefault="qualified">
>
>   <annotation>
>     <documentation xml:lang="en">
>      Editor document definition defines an html based editor
>     </documentation>
>   </annotation>
>
>   <element name="htmlEditor" type="e:HtmlEditorType"/>
>
>   <element name="updateTime" type="dateTime"/>
>
>   <complexType name="HtmlEditorType">
>     <sequence>
>       <element ref="e:updateTime" minOccurs="1" maxOccurs="1" />
>       <element name="fields" type="e:Fields" minOccurs="1" maxOccurs="1" />
>     </sequence>
>   </complexType>
>
>   <complexType name="Fields">
>     <sequence>
>       <element name="field" minOccurs="1" maxOccurs="unbounded">
>         <complexType>
>           <sequence>
>             <element name="shortDesc" type="string" minOccurs="1"
> maxOccurs="1"/>
>             <element name="htmlType" type="e:HtmlTypeType" minOccurs="1"
> maxOccurs="1"/>
>             <element name="allowNull" type="boolean" minOccurs="1"
> maxOccurs="1" />
>             <element name="defaultVal"  type="string"/>
>           </sequence>
>           <attribute name="columnName" type="string" use="required"/>
>         </complexType>
>       </element>
>     </sequence>
>   </complexType>
>
>   <complexType name="HtmlTypeType">
>     <sequence>
>       <element name="name" type="string" />
>       <element name="value" type="string" />
>     </sequence>
>     <attribute name="name" type="e:HtmlNameType" use="required"/>
>   </complexType>
>
>   <simpleType name="HtmlNameType">
>     <restriction base="NMTOKEN">
>       <enumeration value="select"/>
>       <enumeration value="text"/>
>     </restriction>
>   </simpleType>
> </schema>
>
> ------------
>
> 2) When i attept to force external validation with this line of code:
>
> parser.setProperty
>
> ("http://apache.org/xml/properties/schema/external-schemaLocation",
>             "http://www.emilygraham.com/java/other/editor.xsd");
>
> I get this exception:
>
> org.xml.sax.SAXNotRecognizedException:
> http://apache.org/xml/properties/schema/external-schemaLocation
>
> Does anyone know why this would happen?
>
> --------
> 3) Does anyone know where I can get a set of very simple documents that will
> pass MANY different validations.  Just one example would be nice.
>
> Thanks
>
> Tom

Received on Wednesday, 5 December 2001 17:36:37 UTC