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

Re: XML Encoding of XPath: Examples

  • From: Rick Jelliffe <ricko@a...>
  • To: xml-dev@x...
  • Date: Sun, 18 Mar 2001 17:06:16 +0800

xpath examples
From: Murata Makoto <mura034@a...>

>In the string case, regular expressions and finite automata (or regular
>grammars) look very different, but they are equally expressive.
>
>In the tree case, we have a similar result.  The expression approach
>such as XPath (and thus Schematron) and the automaton approach such
>as RELAX and TREX are inherently equivalent.

I disagree. Sort of. They are equivalent only from a theoretical and
reductionist view.

As long as Xpaths are not as powerful as regexes by not having grouping or
reptition, and as long as regexes do not allow full XPaths for particles,
current grammar-based and path-based systems are not remotely equivalent in
fact.

And it is the higher-level abstractions which the schema uses to model
things that give much of the value of language.  Schematron has no notion of
type. XML Schemas has no equivalent to Schematron's pattern. To say
"equivalent" may confuse people that the equivalence is the same equivalence
as saying "C# is equivalent to Java" rather than "a C++ program is
equivalent to its binary compiled form": equivalence does not mean
equivalently useful or useable or congenial.

For example, lets have a pattern called "three equal sized arrays in three
documents" with the definition  "the number of children in element X in this
document should be the same as the number of children of element Y in that
document (URL given in the attribute @Y on the X element in this document)
and it should be the same as the number of children of element Z in another
document (URL given as the attribute @Z on the X element in this document)."

I could easily write an Schematron schema for that in a couple of lines. How
would a conventional grammar-based schema language express that?

Cheers
Rick Jelliffe


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.