aspose file tools*
The moose likes XML and Related Technologies and the fly likes XSD help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSD help" Watch "XSD help" New topic
Author

XSD help

Md Fizal
Ranch Hand

Joined: Dec 23, 2002
Posts: 61
I'm designing a new XSD and having trouble defining the following condition:

In my XML, I want to define a condition saying, only if tag 'Key' exists then tag 'Value' is a required one, otherwise not. This also means that tag 'Key' is optional too.

How do I define this in XSD?
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
<!-- pseudo code. You need to do some hemework, right?. -->
<define a type>
<xsd:sequence>
<define a key tag>
<define a value tag>
</xsd:sequence>
<end define of type>

This is the concept you need.

- m


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
Consider Paul's rocket mass heater.
 
subject: XSD help