Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] XML Schema assistance

From: "David RR Webber (XML)" <w3c@----.---->
To: Ray Cauchi <ray@-----.---.-->
Date: 11/13/2004 1:36:00 AM
Ray,



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.



See http://www.jcam.org.uk



DW

===============================

Ray Cauchi wrote:

Hi folks

  

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:

  

  <?xml
version="1.0" encoding="UTF-8"?>

  <policy
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="myschema.xsd">

  <x-tab>        </x-tab><section>

  <x-tab>        </x-tab><x-tab>        </x-tab><title>Section
1
Title</title>

  <x-tab>        </x-tab><x-tab>        </x-tab><clause>string
text</clause>

  <x-tab>        </x-tab></section>

  <x-tab>        </x-tab><section>

  <x-tab>        </x-tab><x-tab>        </x-tab><title>Section
2
Title</title>

  <x-tab>        </x-tab><x-tab>        </x-tab><clause>string
text</clause>

  <x-tab>        </x-tab><x-tab>        </x-tab><clause>more
text</clause>

  <x-tab>        </x-tab></section>

  <x-tab>        </x-tab><section>

  <x-tab>        </x-tab><x-tab>        </x-tab><title>Section
3
Title</title>

  <x-tab>        </x-tab><x-tab>        </x-tab><clause>text
-
  <link
href="http://www.website.com/">a
link</link></clause>

  <x-tab>        </x-tab></section>

</policy>

  

  So you can see that each main section of a document is marked
up
as a <section></section>, and each section must have a
<title></title>

  

No problem, the schema works fine as far as I have so far
tested.

  

What I wish to do though, is enforce two specific <section>'s :
in
other words, the first <section> in each document will always
have
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
they
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
am
using the XMLSpy">XMLSpy schema GUI tool, and each time I try to provide a
fixed
value, that value becomes global...and thus applies to all
<title>
tags in the document. I am using the <title> element in the
following elements - hence its global definition :

  

<section>

<part>

<hmajor> (major heading)

<hminor> (minor heading)

  

  

  

Do I need to create a <s1title> and <s2title> separate to
my
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.

  

  

  <x-sigsep></x-sigsep>
  Best Regards

  

Ray Cauchi

  Manager/Lead Developer

  

  

  

  

  ( T W E E K ! )

  PO Box 468 Katoomba NSW
Australia 2780

p: +61 2 4757 1600

f: +61 2 4757 3808

m: 0414 270 400

e: ray@t...

w:
  www.tweek.com.au


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent