• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSD help

 
Md Fizal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<!-- 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic