A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Engineering
»
XML and Related Technologies
Author
<xsd:attribute> & <xsd:sequence> mutually exclusive???
Mimi Tam
Ranch Hand
Joined: Mar 05, 2010
Posts: 121
posted
Mar 10, 2010 10:21:22
0
Can anyone tell me how to straighten this out, please?
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="message"> <xs:complexType> <xs:attribute name="id" type="xs:string" use="required"/> [color=red]<xs:sequence minOccurs="0" maxOccurs="unbounded">[/color] <xs:element name="message" type="xs:string"/> <xs:element name="name" type="xs:string"/> <xs:element name="type" type="xs:string"/> <xs:element name="consumer" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema
>
Error is on the <xs: sequence> line.
In my XML:
<!-- client to server (upload info) --> <message id='msg_id'> <name>POST</name> <type>UPDATE</type> <!-- Request to update customer --> <consumer id='113'> <!-- unique Id --> <Hours_used>23</Hours_used> </consumer>dd </message>
The error message:
"s4s-elt-invalid-content.1: The content of '@AnonType_message' is invalid. Element 'sequence' is invalid, misplaced, or occurs too often"
Thanks very much in advance.
xmlerror.png
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
2
I like...
posted
Mar 10, 2010 10:29:01
0
There's a forum for XML. And the question has nothing to do with
JDBC
. Moving...
Benjamin Hiner
Greenhorn
Joined: Feb 27, 2009
Posts: 12
posted
Mar 10, 2010 11:22:25
0
I don't have the reference on me but sequences come before attributes.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="message"> <xs:complexType> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:element name="message" type="xs:string"/> <xs:element name="name" type="xs:string"/> <xs:element name="type" type="xs:string"/> <xs:element name="consumer" type="xs:string"/> </xs:sequence> <xs:attribute name="id" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:schema>
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: <xsd:attribute> & <xsd:sequence> mutually exclusive???
Similar Threads
Schema Confusion?
[schema] Allow an element to have any content
Validating a SOAP document using XSD
How to convert from sql to xml
problem with schemas
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter