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 ne...@ca.ibm.com on 2001/06/13 22:53:41 UTC
RE: duplicate element dsc in the same scope
Hi Sean,
Hope this is still relevant to you after all this time :-). But you did
indeed find a Xerces bug, and it's now fixed in CVS. So do a fresh CVS
checkout or wait until Xerces-j 1.4.1 comes out next week.
Thanks for the report!
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone: 416-448-3519, T/L 778-3519
E-mail: neilg@ca.ibm.com
"McEligot, Sean (contractor)" <Mc...@MTMC.ARMY.MIL> on 05/31/2001
01:51:18 PM
Please respond to xerces-j-user@xml.apache.org
To: "Xerces-J User Mailing List (E-mail)" <xe...@xml.apache.org>
cc:
Subject: RE: duplicate element dsc in the same scope
I'm sorry, Outlook was trashing all my xerces-j-user messages -- Rules
Wizard gone amuck. I thought the list was down. I didn't get to see the
responses to my question and there is still no archive. If you did
response,
could you please repost or send it to me directly.
Thanks,
Sean
> -----Original Message-----
> From: McEligot, Sean (contractor)
> Sent: Friday, May 25, 2001 2:37 PM
> To: Xerces-J User Mailing List (E-mail)
> Subject: duplicate element dsc in the same scope
>
>
> A little background: I have one xsd file that includes two
> others. Each of those two files has an element of the same
> name. Two get around this I defined the elements to be of
> different types. <element name="SameName"
> type="SameNameTypeOne"> and <element name="SameName"
> type="SameNameTypeTwo"> (see below). This seems like it would
> be correct, but I get the following message:
> example.xml:2:108:2:109 Schema error: duplicate element decl
> in the same scope : SameName.
> example.xml:4:33:4:34 Datatype error: In element 'SameName' :
> Value '123' does not match regular expression facet '[a-z]*'..
> example.xml: 1360 ms (5 elems, 1 attrs, 9 spaces, 6 chars)
>
> Can someone tell me if this is my fault or an xerces bug, and
> suggest a way to fix this or a better way to do it?
>
> Thanks,
> Sean
>
>
> Here is an example to duplicate this behaivor:
>
> === example.xml ===
> <?xml version="1.0" encoding="UTF-8"?>
> <Example
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation='example.xsd'>
> <One> <SameName>abc</SameName> </One>
> <Two> <SameName>123</SameName> </Two>
> </Example>
>
> === example.xsd ===
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns='http://www.w3.org/2001/XMLSchema'>
>
> <include schemaLocation="one.xsd" />
> <include schemaLocation="two.xsd" />
>
> <element name="Example">
> <complexType>
> <sequence>
> <element ref="One" minOccurs='0' maxOccurs='unbounded'/>
> <element ref="Two" minOccurs='0' maxOccurs='unbounded'/>
> </sequence>
> </complexType>
> </element>
>
> </schema>
>
> === one.xsd ===
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns='http://www.w3.org/2001/XMLSchema'>
>
> <element name="One">
> <complexType>
> <sequence>
> <element maxOccurs="1" minOccurs="0" name="SameName"
> type="SameNameTypeOne" />
> </sequence>
> </complexType>
> </element>
> <simpleType name="SameNameTypeOne">
> <restriction base="string">
> <pattern value="[a-z]*" />
> </restriction>
> </simpleType>
>
> </schema>
>
> === two.xsd ===
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns='http://www.w3.org/2001/XMLSchema'>
>
> <element name="Two">
> <complexType>
> <sequence>
> <element maxOccurs="1" minOccurs="0" name="SameName"
> type="SameNameTypeTwo" />
> </sequence>
> </complexType>
> </element>
>
> <simpleType name="SameNameTypeTwo">
> <restriction base="string">
> <pattern value="[0-9]*" />
> </restriction>
> </simpleType>
>
> </schema>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org