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

Multiple rules in RELAX (was Re: And the DTD says...)

  • From: Murata Makoto <mura034@a...>
  • To: xml-dev@x...
  • Date: Wed, 10 Jan 2001 22:24:28 +0900

multiple rules
-- Caroline Clewlow wrote:
> Is this something that RELAX takes care of with it's <elementRule role=""
> label="">
> whereby two element rules can have the same role with a different label
> depending on how they constrain their child elements ?

RELAX Core allows the same label to be defined more than once.  
In DTDs, the first one wins.  In programming languages, the 
last one wins.  In RELAX Core, all of them win.

Here is an example of this feature.  Two modules in XHTML Basic 
define the parameter entity "head.content".


In xhtml-struct-1.mod

<!ENTITY % head.content
    "( %HeadOpts.mix;, %title.qname;, %HeadOpts.mix; )"
>

In xhtml-base-1.mod

<!ENTITY % head.content
    "( %HeadOpts.mix;,
     ( ( %title.qname;, %HeadOpts.mix;, ( %base.qname;, %HeadOpts.mix; )? )
     | ( %base.qname;, %HeadOpts.mix;, ( %title.qname;, %HeadOpts.mix; ))))"
>


When xhtml-base-1.mod is used, the dcl in xhtml-struct-1.mod is 
overshadowed.

My rewrite of xhtml-struct-1.mod has a hedgeRule for head.content, 
and my rewrite of xhtml-base-1.mod also has another hedgeRule.
But the first one is never overshadowed.

As a result, the hedgeRule in the rewrite of xhtml-base-1.mod 
can be simplified.  It is equivalent to the following.

<!ENTITY % head.content
    "( %HeadOpts.mix;,
       ( ( %title.qname;, %HeadOpts.mix;, %base.qname;)
       | ( %base.qname;, %HeadOpts.mix;, %title.qname))
     %HeadOpts.mix;)"
>

Although this feature is useful for modularization, I do not 
claim that we can get rid of features of <redefine>.  I 
hope to incorporate <redefine> feeatures in the upcoming 
ISO TR (not DTR) for RELAX Core.

Cheers,

Makoto

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.