tags:

views:

52

answers:

1

I'm trying to parse XML files and I would like to provide a schema to validate against however, since I don't care about some of the tag names, I would like to allow users to specify anything for certain tags.

Example XML:

<root>
    <record>
        <data1>foo</data1><data2>bar</data2>
    </record>
    <record>
        <data2>foo2</data2><data1>bar2</data1>
    </record>
</root>

In this example, the tag names 'data1' and 'data2' are important to the program (mainly because they can appear in any order as shown above) but the tag names, 'record' and 'root' are not.

It would be nice to allow users to specify XML with any (non-empty) string for 'record' and 'root' that would still validate against my schema.

+1  A: 

That defeats the purpose of having a Schema and defining a contract. What it does is requires the user to contact the developer (you) to know how to consume your service. You don't want to get into a situation where the guidelines for knowing how to consume a service is "contact Jack".

David Yancey