This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Enforce Dependencies Between Optional Elements? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Enforce Dependencies Between Optional Elements?" Watch "Enforce Dependencies Between Optional Elements?" New topic
Author

Enforce Dependencies Between Optional Elements?

Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
For the below xml schema section, is there any way to say that the 'remote-ejb-home' element is required ONLY if the 'ejb-version' element is present?

<xs:element name="object">
<xs:complexType>
<xs:sequence>
<xs:element ref="ejb-version" minOccurs="0" maxOccurs="1" />
<xs:element ref="remote-ejb-home" minOccurs="0" maxOccurs="1" />
<xs:element ref="jndi-name" minOccurs="0" maxOccurs="1" />
<xs:element ref="context-name" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>

Thanks a lot in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enforce Dependencies Between Optional Elements?
 
Similar Threads
XSD element validation
SOAP doubt: The Envelope element
Castor minOccurs bean generation
XML schema fails to load
How can I fix element so it can obtain default values if omitted