Werner,

Attached are the schema file, a sample input file and a file with the stack trace from Castor 1.3 of when trying to create an ExampleGrammar Object. I'm running on Window XP with Java 1.6.0. I look forward hearing from you. Thank you.

Rafael

Werner Guttmann wrote:
Hi Rafael,

can you show me the relevant XML schema fragment for which you are
trying to unmarshal XML document instances. And one or more XML document
samples that show what you are actually trying to unmarshal would be of
great use as well.

Let's first have a look at the problem, and then decide whether you are
hit by the same problem as described in below references.

Regards
Werner

Rafael Almanzar wrote:
To whom it may concern:

I read over the threads below and tried the suggestion made on the first
thread (sequence order set to true) and still have the same error when
trying to unmarshal a choice input containing two or more sub elements
(which is valid based on my schema).  This used to work with Castor 1.0;
but not longer with Castor1.3.  Is there any new update/release
available that fixes this problem? I look forward hearing from you. Thank you.

Rafael Almanzar

http://markmail.org/search/?q=choice+incorrect+order#query:choice%20incorrect%20order+page:1+mid:i6kbwuc5nxzluknb+state:results

http://jira.codehaus.org/browse/CASTOR-2657
http://www.mail-archive.com/[email protected]/msg07211.html
http://markmail.org/message/mgjqc2zzh42tc4y3

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by private (private) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:complexType name="BasePatternType">
		<xs:attribute name="displayName" type="xs:string" use="optional"/>
		<xs:attribute name="use" type="xs:string" use="optional" default="required"/>
		<xs:attribute name="tagName" type="xs:string" use="optional"/>
		<xs:attribute name="referenceFile" type="xs:string" use="optional"/>
	</xs:complexType>
	<xs:element name="ExampleGrammar">
		<xs:complexType>
			<xs:sequence>
				<xs:group ref="ExamplePattern" maxOccurs="unbounded"/>
				<xs:element ref="IncludedFile" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="SimplePattern">
		<xs:complexType>
			<xs:complexContent>
				<xs:extension base="BasePatternType">
					<xs:sequence>
						<xs:element name="PatternText" type="xs:string"/>
					</xs:sequence>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="SequencePattern">
		<xs:complexType>
			<xs:complexContent>
				<xs:extension base="BasePatternType">
					<xs:sequence>
						<xs:group ref="ExamplePattern" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="ChoicePattern">
		<xs:complexType>
			<xs:complexContent>
				<xs:extension base="BasePatternType">
					<xs:sequence>
						<xs:group ref="ExamplePattern" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>
	<xs:group name="ExamplePattern">
		<xs:choice>
			<xs:element ref="ChoicePattern" minOccurs="0"/>
			<xs:element ref="SequencePattern" minOccurs="0"/>
			<xs:element ref="SimplePattern" minOccurs="0"/>
		</xs:choice>
	</xs:group>
	<xs:element name="IncludedFile">
		<xs:complexType>	
			<xs:attribute name="filename" type="xs:string" use="required"/>
		</xs:complexType>
	</xs:element>
	
		
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?><ExampleGrammar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="ExampleGrammar.xsd">
	
	<ChoicePattern tagName="ORIENTATION">
		<SimplePattern><PatternText>northwest</PatternText></SimplePattern>
		<SimplePattern><PatternText>northeast</PatternText></SimplePattern>
		<SimplePattern><PatternText>southwest</PatternText></SimplePattern>
		<SimplePattern><PatternText>southeast</PatternText></SimplePattern>
		<SimplePattern><PatternText>north</PatternText></SimplePattern>
		<SimplePattern><PatternText>south</PatternText></SimplePattern>
		<SimplePattern><PatternText>east</PatternText></SimplePattern>
		<SimplePattern><PatternText>west</PatternText></SimplePattern>
	 </ChoicePattern>
</ExampleGrammar>
org.exolab.castor.xml.MarshalException: Element with name SimplePattern passed t
o type ChoicePattern in incorrect order; It is not allowed to be the last elemen
t of this sequence!{File: [not available]; line: 5; column: 18}
        at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalExcept
ion(Unmarshaller.java:794)
        at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:760)
        at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:626)
        at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:840)

<<attachment: ralmanza.vcf>>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to