[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XML Schema assistance

  • To: "Ray Cauchi" <ray@t...>, <xml-dev@l...>
  • Subject: RE: XML Schema assistance
  • From: "Chiusano Joseph" <chiusano_joseph@b...>
  • Date: Tue, 2 Nov 2004 07:32:28 -0500
  • Thread-index: AcTAlpBsABHKAx1FSS+T7uyDcGWyhwAQSgMg
  • Thread-topic: XML Schema assistance

ray cauchi
In general, you'll want to declare local <title> elements for those places in which their declarations differ from the global declarations. This is necessary because these differing <title> elements have the same name as the global <title> element but a different format.
 
Kind Regards,
Joseph Chiusano
Booz Allen Hamilton
Strategy and Technology Consultants to the World
 


From: Ray Cauchi [mailto:ray@t...]
Sent: Monday, November 01, 2004 11:57 PM
To: xml-dev@l...
Subject: XML Schema assistance

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">
        <section>
                <title>Section 1 Title</title>
                <clause>string text</clause>
        </section>
        <section>
                <title>Section 2 Title</title>
                <clause>string text</clause>
                <clause>more text</clause>
        </section>
        <section>
                <title>Section 3 Title</title>
                <clause>text - <link href="http://www.website.com/">a link</link></clause>
        </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 XML Spy 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.


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: http://www.tweek.com.au/


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.