Re: validation error with Xerces131... bug??.
Quoting Thakur Thribhuvan [EMAIL PROTECTED]: Hi Thakur, You have some problems with schema design. The Schema you write isn't valid. You can't use the attribute base directly in a complexType. When you want to create a complexType from a simple Type you have to use: complexType name=Type mixed=0 simpleContent extension base=string/ /simpleContent attribute name='type' type='xsd:string' use='required'/ /complexType Also I see that you declare the Schema namespace to xsd prefix. But why you don't use the prefix xsd when you declare the Types and elements? It's correct? I think that you must put the schema namespace if you want to do it. Bye, Hi, I have written a Schema that contains couple of elements and an attribute. When I validate it using one the samples(dom.DOMCount with -v option) it gives me this error. java dom.DOMCount -v account.xml [Error] account.xml:7:51: The content of element type anu:ProductID must match EMPTY. account.xml: 1362 ms (4 elems, 4 attrs, 11 spaces, 12 chars) I guess the parser seems to assume that the content type as empty for ProductID(one of the elements) when it should be elementOnly which is the default. I am enclosing the xml instance file and the schema. Any pointers would be appreciated. !--XML Schema fragment in file schema1.xsd-- schema targetNamespace='anutech.com' xmlns:xsd='http://www.w3.org/2000/10/XMLSchema' xmlns:anu='anutech.com' element name=rootElement complexType !-- default for content is element only -- sequence element ref=anu:InvoiceNo minOccurs='1' maxOccurs='unbounded'/ element ref=anu:ProductID minOccurs='1' maxOccurs='unbounded' / element ref=anu:ProductCode minOccurs='1' maxOccurs='unbounded'/ /sequence /complexType /element !-- Global declarations -- element name='InvoiceNo' type='xsd:integer'/ element name='ProductCode' type='xsd:string' / element name='ProductID' complexType base='xsd:string' derivedBy='extension' content='elementOnly' attribute name='type' type='xsd:string' use='required'/ /complexType /element /schema !-- instance file -- ?xml version=1.0 encoding=UTF-8? anu:rootElement xmlns:anu='anutech.com' xmlns:xsi=http://www.w3.org/2000/10/XMLSchema-instance; xsi:schemaLocation='anutech.com account.xsd' anu:InvoiceNo123456789/anu:InvoiceNo anu:ProductID type='sometype'99/anu:ProductID anu:ProductCodeA/anu:ProductCode /anu:rootElement - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Joan Pujol Espinar PTS Sistemes Departament IMA Universitat de Girona - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: validation error with Xerces131... bug??.
Hi Joan, Thank you for your reply. But the Xerces Parser 1.3.1 uses 'http://www.w3.org/2000/10/XMLSchema' (candidate recommendation) and hence the parser doesn't recognize extension as the direct child of simpleContent. This is the error I get, [Error] account.xml:4:54: Schema error: ComplexType 'ProductID': Invalid child following the simpleContent child in the complexType. Any more pointers would be appreciated. -Thakur -Original Message- From: Joan Pujol Espinar [mailto:[EMAIL PROTECTED] Sent: Sunday, October 28, 2001 3:25 PM To: [EMAIL PROTECTED] Subject: Re: validation error with Xerces131... bug??. Quoting Thakur Thribhuvan [EMAIL PROTECTED]: Hi Thakur, You have some problems with schema design. The Schema you write isn't valid. You can't use the attribute base directly in a complexType. When you want to create a complexType from a simple Type you have to use: complexType name=Type mixed=0 simpleContent extension base=string/ /simpleContent attribute name='type' type='xsd:string' use='required'/ /complexType Also I see that you declare the Schema namespace to xsd prefix. But why you don't use the prefix xsd when you declare the Types and elements? It's correct? I think that you must put the schema namespace if you want to do it. Bye, Hi, I have written a Schema that contains couple of elements and an attribute. When I validate it using one the samples(dom.DOMCount with -v option) it gives me this error. java dom.DOMCount -v account.xml [Error] account.xml:7:51: The content of element type anu:ProductID must match EMPTY. account.xml: 1362 ms (4 elems, 4 attrs, 11 spaces, 12 chars) I guess the parser seems to assume that the content type as empty for ProductID(one of the elements) when it should be elementOnly which is the default. I am enclosing the xml instance file and the schema. Any pointers would be appreciated. !--XML Schema fragment in file schema1.xsd-- schema targetNamespace='anutech.com' xmlns:xsd='http://www.w3.org/2000/10/XMLSchema' xmlns:anu='anutech.com' element name=rootElement complexType !-- default for content is element only -- sequence element ref=anu:InvoiceNo minOccurs='1' maxOccurs='unbounded'/ element ref=anu:ProductID minOccurs='1' maxOccurs='unbounded' / element ref=anu:ProductCode minOccurs='1' maxOccurs='unbounded'/ /sequence /complexType /element !-- Global declarations -- element name='InvoiceNo' type='xsd:integer'/ element name='ProductCode' type='xsd:string' / element name='ProductID' complexType base='xsd:string' derivedBy='extension' content='elementOnly' attribute name='type' type='xsd:string' use='required'/ /complexType /element /schema !-- instance file -- ?xml version=1.0 encoding=UTF-8? anu:rootElement xmlns:anu='anutech.com' xmlns:xsi=http://www.w3.org/2000/10/XMLSchema-instance; xsi:schemaLocation='anutech.com account.xsd' anu:InvoiceNo123456789/anu:InvoiceNo anu:ProductID type='sometype'99/anu:ProductID anu:ProductCodeA/anu:ProductCode /anu:rootElement - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Joan Pujol Espinar PTS Sistemes Departament IMA Universitat de Girona - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validation error with Xerces131... bug??.
Hi, I have written a Schema that contains couple of elements and an attribute. When I validate it using one the samples(dom.DOMCount with -v option) it gives me this error. java dom.DOMCount -v account.xml [Error] account.xml:7:51: The content of element type anu:ProductID must match EMPTY. account.xml: 1362 ms (4 elems, 4 attrs, 11 spaces, 12 chars) I guess the parser seems to assume that the content type as empty for ProductID(one of the elements) when it should be elementOnly which is the default. I am enclosing the xml instance file and the schema. Any pointers would be appreciated. !--XML Schema fragment in file schema1.xsd-- schema targetNamespace='anutech.com' xmlns:xsd='http://www.w3.org/2000/10/XMLSchema' xmlns:anu='anutech.com' element name=rootElement complexType !-- default for content is element only -- sequence element ref=anu:InvoiceNo minOccurs='1' maxOccurs='unbounded'/ element ref=anu:ProductID minOccurs='1' maxOccurs='unbounded' / element ref=anu:ProductCode minOccurs='1' maxOccurs='unbounded'/ /sequence /complexType /element !-- Global declarations -- element name='InvoiceNo' type='xsd:integer'/ element name='ProductCode' type='xsd:string' / element name='ProductID' complexType base='xsd:string' derivedBy='extension' content='elementOnly' attribute name='type' type='xsd:string' use='required'/ /complexType /element /schema !-- instance file -- ?xml version=1.0 encoding=UTF-8? anu:rootElement xmlns:anu='anutech.com' xmlns:xsi=http://www.w3.org/2000/10/XMLSchema-instance; xsi:schemaLocation='anutech.com account.xsd' anu:InvoiceNo123456789/anu:InvoiceNo anu:ProductID type='sometype'99/anu:ProductID anu:ProductCodeA/anu:ProductCode /anu:rootElement - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]