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

Relax-NG schema design question

  • To: xml-dev@l...
  • Subject: Relax-NG schema design question
  • From: Lars Oppermann <Lars.Oppermann@S...>
  • Date: Tue, 30 Nov 2004 10:49:03 +0100
  • Organization: Sun Microsystems Inc.
  • User-agent: Mozilla Thunderbird 0.9 (Windows/20041103)

xmllint relax ng
Hi folks,

I'm working on the OpenDocument (OpenOffice) format specification. We 
are using RelaxNG for our schema and recently semm to have discovered a 
flaw in our schema which some validators don't regard as a flaw (e.g. 
sun multi schema validator (2003-02-25) and jing (2003-06-19)), but 
others do (e.g. xmllint (libxml2-2.6.16)).

We are using attributes, which contain a list of values. The type of 
those values is referenced rather then defined every time it is used. E.g.:

<define name="draw-enhanced-geometry-attlist" combine="interleave">
   <optional>
     <attribute name="draw:extrusion-depth" a:defaultValue="36pt 0">
       <list>
         <ref name="length"/>
         <ref name="double"/>
       </list>
     </attribute>
   </optional>
</define>

Where for example length is defined elsewhere as

<define name="length">
   <data type="string">
     <param name="pattern">
       -?([0-9]+(\.[0-9]*)?|\.[0-9]+)((cm)|(mm)|(in)|(pt)|(pc)|(px))
     </param>
   </data>
</define>


Only the fact, that xmllint reported "element ref: Relax-NG parser 
error: Found forbidden pattern list//ref" made us aware of the fact, 
that relax-ng in fact constraints the use of refs in lists. 
(http://books.xmlschemata.org/relaxng/ch17s02.html#id2877724)
I do see the reason for the contraint, but what would be the right way 
to define such structures? Repeating the pattern every time the ref was 
used would solve the error, but would mess up the design quite a bit, 
since there wouldn't be a central place where types like length could be 
maintained. So if one decided to at e.g. 'ft' to the pattern, all 
occurences would have to be updated.

I'm new to relax-ng and I hope I'm just missing something obvious here. 
I'm also not quite sure what I should make of the fact, that some 
validators

Bests,
~Lars

-- 
Lars Oppermann <lars.oppermann@s...>               Sun Microsystems
Software Engineer - StarOffice                           Sachsenfeld 4
Phone: +49 40 23646 959                                D-20097 Hamburg
Fax:   +49 40 23646 550                  http://www.sun.com/staroffice

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.