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

Re: Re: Schemas: Different Strokes From Different Folks

  • From: George Bina <george@oxygenxml.com>
  • To: "Henry S. Thompson" <ht@markup.co.uk>, John Cowan <johnwcowan@g...>
  • Date: Thu, 19 Jan 2017 22:59:14 +0200

Re:  Re: Schemas: Different Strokes From Different Folks
Hi,

To combine two schemas in Relax NG to form a union one will use a choice of two externalRef patterns, each pointing to a schema. The externalRef basically creates a new context and pattern Y from one schema is different from pattern Y from the other, thus the union in your example will generate only {a z, b}.

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 19/01/17 19:28, Henry S. Thompson wrote:
John Cowan <johnwcowan@gmail.com> writes:

On Wed, Jan 18, 2017 at 4:17 PM, Henry S. Thompson <ht@markup.co.uk> wrote:

I understood Murata to have proved for RELAX NG that given two XML
languages, each (weakly) generated by a RELAX NG schema, the union _of
the languages_ would be generated by the union of the schemata.

Indeed, the proof is trivial.  Let a be the root pattern of schema A, and b
be the root pattern of schema B.  Then <choice><ref name="a"/><ref
name="b"/></choice> matches any document that matches either a or b or
both.  And since there are no constraints on the subpatterns of a choice
pattern other than those inherited from the context of the choice pattern
(which here is null), all such patterns are valid.
<academicInterestOnly>
Consider the following two CF-PSGs:

 1) S -> X
    X -> Y z
    Y -> a

 2) S -> Y
    Y -> b

(1) generates L1={a z}
(2) generates L2=(b}

(1) U (2) generates {a z, b, b z}, which is a proper superset of L1 U L2.

It is straightforward to port this example to RELAX NG:

  1) start = X
     X = element x { Y , element z { empty } }
     Y = element { element a { empty } }

  2) start = Y
     Y = element b { empty }

with a parallel effect.

So what you've offered above doesn't constitute the desired proof.

The proof that context-free _languages_ are closed under union (see
for example (first one Google offered me) [1]) involves a relabelling
step for non-terminal symbols, precisely to avoid this 'capture'
problem.  A similar step would obviously be possible for RELAX NG.

So the class of RELAX NG _languages_ is closed under union, but it
probably doesn't really make sense to say the _formalism_ is closed
under union.

</academicInterestOnly>

ht



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.