Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

.xsd schema questions

 
jim li
Ranch Hand
Posts: 180
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i have complextypes in .xsd schema file, and i want the complextypes to be generated as the order i preferred from java classes.

ie,

<xs:complexType name="currency">
<xs:sequence>
<xs:element name="currencyCode" type="tns:codedValue"/>
<xs:element name="amount" type="xs:double"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="codedValue">
<xs:sequence>
<xs:element name="codeSystem" type="xs:string"/>
<xs:element name="code" type="xs:string"/>
<xs:element minOccurs="0" name="displayName" type="xs:string"/>
</xs:sequence>
</xs:complexType>


since currency is depend on codedvalue. i want coded value to be generated first:

<xs:complexType name="codedValue">
<xs:sequence>
<xs:element name="codeSystem" type="xs:string"/>
<xs:element name="code" type="xs:string"/>
<xs:element minOccurs="0" name="displayName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="currency">
<xs:sequence>
<xs:element name="currencyCode" type="tns:codedValue"/>
<xs:element name="amount" type="xs:double"/>
</xs:sequence>
</xs:complexType>



thank you
 
Kumar Raja
Ranch Hand
Posts: 547
2
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jim,

What do you mean by generated here? How are you trying to generate these xsds? Are these not manually written ?
 
Dan Drillich
Ranch Hand
Posts: 1183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XML Schema Tutorial: Power Schemas with Stylus Studio says -

In general, there is no preferred order within a schema document ...



Btw, the BP goes out of its way to ensure "proper" ordering of the schema's content.

Regards,
Dan
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic