This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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>
<define a key tag>
<define a value tag>
<end define of type>

This is the concept you need.

- m

Take a Minute, Donate an Hour, Change a Life
Have you checked out Aspose?
subject: XSD help
It's not a secret anymore!