XSD - Compare consecutive elements

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xmlnovice
    New Member
    • Nov 2009
    • 1

    XSD - Compare consecutive elements

    Is there any way of requiring the value of an element's attribute to equal the value of a child element of the previous element. What I mean is hopefully explained by the following snippet from an XML file.
    Code:
    <venue city="London">
    <nextvenue>Sydney</nextvenue>
    </venue>
    <venue city="Sydney">
    <nextvenue>Rome</nextvenue>
    </venue>
    I have been asked to create an XSD file for existing XML files whose structure cannot be changed, and I need to ensure that each <nextvenue> element has a value that matches the city attribute of the following <venue> element. Is this possible?
    Last edited by Dormilich; Nov 17 '09, 11:44 PM. Reason: Please use [code] tags when posting code
Working...