I've been validating schemas with IBM's Schema Quality Checker, and using Xerces to validate instance documents against the schemas. Untill now, I've not had any conflict between what the two tools report as a valid schema, but the following small file passes Xerces validation and fails according to SQC. I've not been able to make SQC happy with it yet; is this a problem with SQC, with Xerces, or with the schema spec? Thanks, David A. Riggs ############################################### # Command line validating with Xerces 1.4.3: ############################################### java -classpath xerces.jar;xercesSamples.jar dom.DOMCount -nvsf instance.xml ############################################### # IBM Schema Quality Checker v1.2.004 output: ############################################### Initializing Schema Quality Checker. Please wait ... SchemaQualityChecker has been initialized schema.xsd (file 1 of 1) now being read ... ERROR file = file:D:/SQC/schema.xsd line 18 column 40 SEVERITY: 0 ERROR TYPE: 2 MESSAGE No node in element http://birch.asset.com:ROOT corresponds to <xsd:selector xpath="PERSON"/> defined in <xsd:key name="PERSON_KEY"> <selector xpath="PERSON"/> <field xpath="@PERSON_ID"/> </xsd:key> . Invalid XPath starting from http://birch.asset.com:ROOT:PERSON. ########################################## # The XML Schema ########################################## <?xml version="1.0" encoding="UTF-8"?> <xsd:schema targetNamespace="http://birch.asset.com" xmlns="http://birch.asset.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xsd:element name="ROOT"> <xsd:complexType> <xsd:sequence> <xsd:element name="PERSON" minOccurs="0" maxOccurs="unbounded"> <xsd:complexType> <xsd:attribute name="PERSON_ID" type="SSN" use="required"/> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:key name="PERSON_KEY"> <xsd:selector xpath="PERSON"/> <xsd:field xpath="@PERSON_ID"/> </xsd:key> </xsd:element> <xsd:simpleType name="SSN"> <xsd:restriction base="xsd:string"> <xsd:length value="9"/> <xsd:pattern value="\d{9}"/> </xsd:restriction> </xsd:simpleType> </xsd:schema> ##################################### # The XML Instance used with Xerces ##################################### <ROOT xmlns="http://birch.asset.com" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://birch.asset.com schema.xsd"> <PERSON PERSON_ID="123456789"/> </ROOT> ######################################################## David A. Riggs Science Applications International Corporation - SAIC (304)284-9000x201 [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
