[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] (slight correction) Re: Are we losing out because of grammars?
(Sorry, the rules I sent had a lot of errors, so I am sending them again. I apologise for not being a robot.) Off the top of my head, grammars like ( a, (a |b)*, c, (a, b)+, b )+ are pretty hard to model completely. One can easily infer the rules - there can only be a, b, c test="count(*) = count(a)+count(b)+count(c)" inferred by counting elements - there must be at least 1 c, at least 2 b, and at least 2 a test="c" test="count(b) > 1" test="count(a) >1" inferred by counting required elements - it must start with a and end with a b test="*[1][self::a]" test="b[not(next-sibling::*)]" inferred by looking at the start start and tracing from the end state - c must be followed by a test="count(c[next-sibling::a]) = count(c)" inferred by making lists of allowed following elements (is this Warshall's closure?) - there must be a sequence of cab and abb test="c[next-sibling::a[next-sibling::b]]" test="c[next-sibling::b[next-sibling::b]]" inferred by tracing required sequences. 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
|