473,569 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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),("":ori gin_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:complexTyp e name="fx_type">
<xsd:choice>
<xsd:sequence >
<xsd:element name="tag" type="xsd:strin g" minOccurs="1"
maxOccurs="1"/>
</xsd:sequence>
<xsd:sequence >
<xsd:element name="tag" type="xsd:strin g" minOccurs="1"
maxOccurs="1"/>
<xsd:element name="origin_sy stem" type="xsd:strin g"
minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:choice>
</xsd:complexType >

</xsd:schema>

Heres the XML...

<?xml version="1.0" encoding="UTF-8"?>
<fx>
<tag>$000000000 2275ABD</tag>
<origin_system> PAB</origin_system>
</fx>
Jul 20 '05 #1
0 1599

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

Similar topics

5
611
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 an ASPX page with a Header User Control and a Footer User Control. I'd like to put the transformed XML right in the middle. It seems like this is...
9
3274
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 no longer wait. Some Googling pointed me to several beginner tutorials, and I chose to get myself going with the guide at ...
3
5014
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
1347
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. Question: Suppose you were working on a system that used a simple XML data transfer protocol that relied on HTTP as it's transport layer and...
3
1263
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 representation of some data (mostly xml i guess). To make my question more clearly i have an example:
3
1456
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 go with this technique. In my case, what I am interested in doing is to store information about reports and report parameters that I might want to...
0
991
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 150 pages. Question 1 - If I use xml for the content on these pages...how big can an xml document be before its too big. Should I create a separate...
5
1656
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 achieve is something like this: <xml> <msg type='methodCall'> <method name='Stop'> <params Id='200701081215'
11
355
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 works! However, if the browser makes a request for any other XML file, it fails. My guess is the ASP.NET DLL can't render .XML files. Is there
2
2494
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 produce a new xml file. This needs to be automated through ant. The ant script is working fine, and I am usign the <transform> function to use my xslt...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.