[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Duplicate element decl in the same scope

  • To: <xml-dev@l...>
  • Subject: Duplicate element decl in the same scope
  • From: "Robert Soesemann" <rsoesemann@s...>
  • Date: Tue, 11 Jan 2005 14:01:18 +0100
  • Thread-index: AcT33aRJy1pcU/jwSJGHLqU0NBq8qw==
  • Thread-topic: Duplicate element decl in the same scope

duplicate xml
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.