On Wed, 14 Nov 2001, Sean Russell wrote: > Robert Feldt wrote: > > > BTW, anyone got a XML grammar out there? Would be fun to try and generate > > a parser for it in the Rockit 0.4 series... > > No, but it should be pretty easy to extract it from the spec. That's what > I did with XPath, to create that grammar you and I have been discussing. > > I'm still stuck on the excludes, though. I'm not sure how to rewrite the > grammar to get a BNF rule: > > something := every_token - but_this > You could try a trick with Regexps, the "zero width negative lookahead". Essentially /(?!but_this_tokens)(every_token)/ but you have to fill in the details. Example is /(?!a|bc)(\w+)/ which would be something -> words - specials words -> /\w+/ specials -> 'a' | 'bc' /Robert