logo       

Related Msgs: audio.musicbrai...    enbd.general/20...    ietf.idr/2002-0...    java.ant-contri...    gnu.make.genera...    qplus.devel/200...    video.freevo.cv...    os.netbsd.ports...    yellowdog.gener...    xfree86.cvs/200...    search.nutch.us...    freedesktop.xse...    programming.swi...    capabilities.ge...    telephony.pbx.a...    mail.sylpheed.c...    db.firebase.por...    boot-loaders.u-...    recreation.radi...    netbsd.bugs/200...    web.zope.plone....    user-groups.lin...   

Issue with choice of group elements:: msg#00102

Subject: Issue with choice of group elements:
Hello,

I am getting a Schema Validation failure using Xerces 2.6.2
with JSDK 1.4.2.

My Schema is like this:

<xs:group name="Input1">
  <xs:sequence>
    <xs:element ref="dog" maxOccurs="1" minOccurs="1" />
    <xs:element ref="cat" maxOccurs="1" minOccurs="1" />
  </xs:sequence>
</xs:group>

<xs:group name="Input2">
  <xs:sequence>
    <xs:element ref="dog" maxOccurs="1" minOccurs="1" />
    <xs:element ref="cat" maxOccurs="1000" minOccurs="1" />
  </xs:sequence>
</xs:group>

<xs:group name="Input3">
  <xs:sequence>
    <xs:element ref="dog" maxOccurs="1000" minOccurs="1" />
    <xs:element ref="cat" maxOccurs="1" minOccurs="1" />
  </xs:sequence>
</xs:group>

<xs:element name="Animals">
  <xs:complextType>
    <xs:choice>
      <xs:group ref="Input1" />
      <xs:group ref="Input2" />
      <xs:group ref="Input3" />
    </xs:choice>
  </xs:complexType>
</xs:element>


I would expect from this schema that <animals> would be
allowed to have 1 cat and 1 dog.  If it has more than one
dog, there should be only 1 cat and vice-versa.

When I generate XML with 1 can and multiple DOGs, Xerces
gives me the following error:

Error on line 15: cvc-complex-type.2.4.d: Invalid content was found
starting with element 'DOG'. No child element is expected at this point.


If I move around the order of the groups in the choice block,
only the first instance gets used in the validation.

Is there a workaround for this?

Can anyone suggest an alternative way to write a schema that
would enforce this restriction?

Thanks!

Rob.



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo