473,324 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Question about XML-Schema choice structure.

GB
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),("":origin_system)))'.

Here's the schema....

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="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>
Jul 20 '05 #1
0 1586

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Victor Fees | last post by:
I have an XML string in a database that I would like to display using XSLT. All of that works like a champ, but I can't figure out how to embed the XML inside an ASPX page. For example, I have...
9
by: Tom | last post by:
Hey all, I've been planning to get myself started with DocBook for quite some time now, so when I unexpectedly encountered a task for which DocBook might actually be very useful, I thought I'd...
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
1
by: spark | last post by:
I was asked this question...anyone have any insight? I am not really sure what it is asking for. I know a little about XML, but i really dont get this question. Any help would be appreciated. ...
3
by: Markus Strobl | last post by:
Hi! I have a general question concerning xml digital signatures. Is XML-DSIG verifying that the content of the XML document isn't modified or does XML-DSIG really signs the binary...
3
by: Henry | last post by:
I know it is possible to store dynamic propterties for applications in XML files. The app.config and the web.config files can be used to store AppSettings... I am just wondering how far one can...
0
by: trickyjw | last post by:
Hi, I've just started learning xml and have a question to ask. I understand how to create a xml document and bind it etc in dreamweaver 8. I am about to redesign a static website that contains about...
5
by: mike | last post by:
Hi People, Wondering whether anyone can help me with a beginner question. I would like to embed some xml within xml. I've tried wrapping it with CDATA but no success. What I would like to...
11
by: digitalcolony | last post by:
I had the .XML extension mapped to the ASP.NET DLL. And then I updated the web.config as such. <httpHandlers> <add verb="*" path="sitemap.xml" type="HttpExtensions.SitemapHandler"/ And it...
2
by: astroboiii | last post by:
New to the whole xml thing and finding w3schools to be an excellent resource. Now down to my question: I have several xml files I need to parse through and grab relevant information from and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.