OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Duplicate element decl in the same scope

[ Lists Home | Date Index | Thread Index ]
  • To: <xml-dev@lists.xml.org>
  • Subject: Duplicate element decl in the same scope
  • From: "Robert Soesemann" <rsoesemann@sapient.com>
  • Date: Tue, 11 Jan 2005 14:01:18 +0100
  • Thread-index: AcT33aRJy1pcU/jwSJGHLqU0NBq8qw==
  • Thread-topic: Duplicate element decl in the same scope

Hello,

For the XML format of my application I need to store semantics inside
attribute value:

So instead of (A) I need (B):
(A)
<root>
	<ELEM1/>
	<ELEM2/>
</root>
(B)
<root>
	<top name="ELEM1"/>
	<top name="ELEM2"/>
</root>

The problem I face is how to validate this with XMLSchema as e.g. two
<top> elements are different only regarding an attribute value. You find
a simple example of an XSD snippet where I test the above XML with
xs:all.

<xs:element name="root">
  <xs:complexType>
   <xs:all>
    <xs:element name="element">
     <xs:complexType>
      <xs:attribute name="name" type="xs:string" fixed="ELEM1"/>
     </xs:complexType>
    </xs:element>
    <xs:element name="element">
     <xs:complexType>
      <xs:attribute name="name" type="xs:string" fixed="ELEM2"/>
     </xs:complexType>
    </xs:element>
   </xs:all>
  </xs:complexType>
 </xs:element>

When I validate this XSD *itself* I get the following error inside my
XML Suite: 
"Duplicate element decl in the same scope: element
'element' and 'element' violate the Unique Particle Attribution rule"

Any solutions. Is this not solveable in XSD?

Robert




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS