XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Vinotha SuntharSubject: Need help with Unique Partcile Attribute Rule (UPAR)
Author: Vinotha Sunthar
Date: 06 Jan 2005 11:57 PM
Hi,

I'm trying to parse some xsd code (found below) with Xcerces.

I see, after a bit of research on the internet, the problem here
has to with violation of UPAR, but i'm finding it difficult to define the
'systemProvider' element in such way it doesn't violate this rule.
Could someone please assist me on how it can be done?

(I tried to follow the name, first-name, last-name examples widley found
in the internet to fix the problem, but this particular element definiton seems
to be a bit more complicated. Any help would be much appreciated.)

<xsd:element name="systemProvider">
<xsd:complexType>
<xsd:sequence>
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="admin"/>
<xsd:element ref="error" minOccurs="0"/>
</xsd:sequence>
<xsd:element ref="deviceTypeInfo" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="error" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

Thank you in advance.
Vino

Posttop
(Deleted User) Subject: Need help with Unique Partcile Attribute Rule (UPAR)
Author: (Deleted User)
Date: 08 Jan 2005 08:20 AM
Hi Vino,
at a first glance, the problem is in the definition of the "error" element:

><xsd:element name="systemProvider">
><xsd:complexType>
> <xsd:sequence>
> <xsd:sequence minOccurs="0" maxOccurs="unbounded">
> <xsd:element ref="admin"/>
> <xsd:element ref="error" minOccurs="0"/>
> </xsd:sequence>
> <xsd:element ref="deviceTypeInfo" minOccurs="0" maxOccurs="unbounded"/>
> <xsd:element ref="error" minOccurs="0"/>
> </xsd:sequence>
></xsd:complexType>
></xsd:element>

If you have to validate this XML

<systemProvider>
<admin/>
<error/>
</systemProvider>

the validator cannot decide if this "error" element is the reference
coming after the "admin" element or the one coming after "deviceTypeInfo"
(because the "deviceTypeInfo" can be absent).

If the last "error" element is associated with the previous "deviceTypeInfo"
you can try changing the schema to have a second sequence like this

<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="deviceTypeInfo"/>
<xsd:element ref="error" minOccurs="0"/>
</xsd:sequence>

Hope this helps,
Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

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