ignoring elements order in xml validation against xsd

Posted by segolas on Stack Overflow See other posts from Stack Overflow or by segolas
Published on 2010-06-03T14:52:37Z Indexed on 2010/06/03 14:54 UTC
Read the original article Hit count: 240

Filed under:
|
|

Hi,

Ia processing an email and saving some header inside a xml document. I also need to validate the document against a xml schema.

As the subject suggest, I need to validate ignoring the elements order but, as far as I read this seems to be impossible. Am I correct?

If I put the headers in a<xsd:sequence>, the order obviously matter. If I us the order is ignored but for some strange reason this imply that the elements must occur at least once.

My xml is something like this:

<headers>
  <subject>bla bla bla</subject>
  <recipient>[email protected]</recipient>
  <recipient>rcp02domain.com</recipient>
  <recipient>[email protected]</recipient>
</headers>

but I think the final document is valid even if subject and recipient elements are swapped.

There is really nothing to do?

© Stack Overflow or respective owner

Related posts about Xml

Related posts about validation