Could you give an example of a "Regex for XML" in RelaxNG-like notation that
XPath cant do (or cant do well) so I can get the idea ?
something like this ???
RelaxNG-like RegEx: First name of all bill or ship people
element invoice {
(element bill_to | element ship_to ) {
element name {
attribute
first
}
}
}
XPath:
/invoice/(bill_to|ship_to)/name/@first
Not sure what I'm missing here. Where would a RelaxNG-like syntax be
helpful ?
Could you give an example of what you have in mind ?
----------------------------------------
David A. Lee
[email protected]
http://www.xmlsh.org
From: [email protected] [mailto:[email protected]] On Behalf
Of Henry Luo
Sent: Friday, November 25, 2011 9:15 PM
To: [email protected]
Subject: Re: [xquery-talk] [ANN] Candle 0.10 Beta Release - a new scripting
language for XML and more
Hi David
Thanks for your insightful reply.
So you said, in order no to hijack XQuery talk, I'll response only to the
question on RELAX NG, and I'll leave rest of my thoughts to my blog.
The way for RELAX NG to work as a search pattern is just like how RegEx
works for string. RELAX NG can be seen as regular expression on nodes. Of
course when using RELAX NG for search, one does not use the whole schema,
instead he just write a rule that matches some nodes. There are pros and
cons comparing to XPath. The strength of RELAX NG kind of node pattern is
probably in searching for a range of nodes (with wildcard node in between).
Of course, such usage goes beyond RELAX NG. But if we can have RegEx for
string, we can also have RegEx for nodes. RELAX NG is not designed for that
kind of usage, but can be the basis for such work.
Regards
Henry
_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk