Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Question about XML-Schema choice structure.

Reply
Thread Tools

Question about XML-Schema choice structure.

 
 
GB
Guest
Posts: n/a
 
      09-16-2003
If I define the following schema which allows either a tag element OR
an tag and origin_system elements I get an error. Same thing happens
when I use groups. Is this because tag is defined twice? My reading of
the XML-Schema spec seems to suggest that the schema is valid & that
Xerces is in error.

I get the error with Java Xerces 2.3.0 but not with C++ Xerces 1.7.0.

Can anyone explain?

Here's the error...

error [4,16] cvc-complex-type.2.4.a: Invalid content starting with
element 'origin_system'. The content must match
'((("":tag))|(("":tag),(""rigin_system)))'.

Here's the schema....

<?xml version="1.0"?>
<xsd:schema xmlnssd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="fx" type="fx_type"/>

<xsd:complexType name="fx_type">
<xsd:choice>
<xsd:sequence>
<xsd:element name="tag" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
</xsd:sequence>
<xsd:sequence>
<xsd:element name="tag" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
<xsd:element name="origin_system" type="xsd:string"
minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:choice>
</xsd:complexType>

</xsd:schema>

Heres the XML...

<?xml version="1.0" encoding="UTF-8"?>
<fx>
<tag>$0000000002275ABD</tag>
<origin_system>PAB</origin_system>
</fx>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ as choice for long term application choice. miles.jg C++ 16 11-14-2007 03:43 PM
set & random.choice question stevecanfield@yahoo.com Python 4 12-15-2005 06:53 AM
Design question; container choice... deancoo C++ 5 02-17-2005 10:32 PM
Can Choice components respond to keyboard input like HTML Choice components? Mickey Segal Java 0 02-02-2004 10:59 PM
Choice of DHCP-server? Is the "IOS-one" a good choice? Fred Cisco 1 12-11-2003 06:25 AM



Advertisments