|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML Encoding of 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








