If you have a lot of interdependencies and contextual rules - you may
want to look at augmenting your simple schema with a real rules
validation engine that uses XPath expressions.
Ray Cauchi wrote:
I have defined a W3C XML Schema that allows markup of Policy documents.
(BTW - I am new at schema design!)
A valid xml structure follows:
So you can see that each main section of a document is marked
as a <section></section>, and each section must have a
No problem, the schema works fine as far as I have so far
What I wish to do though, is enforce two specific <section>'s :
other words, the first <section> in each document will always
a specific <title>. That being, for arguments sake,
<title>Section 1: Policy Purpose</title>.
Similarly, the second section will also have a specific title - that
being <title>Section 2: Document Glossary</title>
All other <title>'s used in a document will be required (where
exist), but their content will not be fixed.
I have made <title></title> a global element. How can i now
instantiate it twice, with specific content, once for each section?? I
using the XML Spy schema GUI tool, and each time I try to provide a
value, that value becomes global...and thus applies to all
tags in the document. I am using the <title> element in the
following elements - hence its global definition :
<hmajor> (major heading)
<hminor> (minor heading)
Do I need to create a <s1title> and <s2title> separate to
original <title> element, or is there a more clever way of
approaching this issue? I am thinking there is but I am a tad stumped!
Any assistance would be hugely appreciated.
( T W E E K ! )
PO Box 468 Katoomba NSW
p: +61 2 4757 1600
f: +61 2 4757 3808
m: 0414 270 400