TEST

– Processing Instructings for Tests

To help users understand your eXtensible Markup Languages, it’s useful to have examples of both what is and isn’t permitted. When designing the structure and rules for the language, it’s useful to include these into a suite of tests which check that the structure and rules fit the examples and vice versa.

How can you indicate that an example is meant to be invalid ?

Each example should include both comments to explain intent,
and Processing Instructions to enable comparison against test result.

eg. <?test type=”schema” expected=”invalid”?>
<!– This example is schema invalid because we have omitted the required attribute, ‘scheme’. ==>

This is safe, as Processing Instructions which are not recognised are ignored by XML apps.

It is also worthwhile storing documents in different paths to make it easier to distinguish valid examples from invalid.