it is sort of a pending issue. but only when you use "noTargetNamespaceLocation". Please use a schema with targetNameSpace defined for you sample to avoid this problem. when noTargetNamespaceLocation is specified, the Schema spec is unclear about how to bind unprefixed names in the instance document. Anyway, if you want to use noTargetNamespaceLocation, for now, don't use any duplicate names for elements and types, this issue will be solved after W3C wg clearly articulate what's the right thing to do with the "noTargetNamespaceLocation". _____
Eric Ye * IBM, JTC - Silicon Valley * [EMAIL PROTECTED] ----- Original Message ----- From: "Andreas Junghans" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 06, 2000 4:32 AM Subject: Scope of element declarations > Hi there, > > it seems Xerces-J doesn't correctly support locally scoped elements. > I've tried to validate the following document and schema: > > <?xml version="1.0"?> > <a > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" > xsi:noNamespaceSchemaLocation="test.xsd" > > > <elem>hello</elem> > </a> > > <?xml version="1.0"?> > <schema> > <complexType name="a-type"> > <element name="elem" type="string"/> > </complexType> > <element name="a" type="a-type"/> > <complexType name="b-type"> > <element name="elem" type="string"/> > </complexType> > <element name="b" type="b-type"/> > </schema> > > When I try to validate this, I get the following error message: > > org.xml.sax.SAXParseException: Schema error: duplicate element decl in > the same > scope : elem. > > As far as I understand the schema WD, both element declarations should > be scoped locally, so there shouldn't be a conflict. Could someone > please tell me if I got something wrong or if this is a bug/todo > feature? > > Xerces-J version used: 1.1.2 > > Best regards > > Andreas Junghans > > -- > ISB GmbH Phone ++49 721 82800-40 or -0 > Karlstraße 52-54 Fax ++49 721 82800-82 > 76133 Karlsruhe mailto:[EMAIL PROTECTED] > Germany http://www.isb-ka.de >