As already been posted, Sebastien and I had been working on System.Security.Cryptography.Xml (i.e. XML Signature) implementation, and now it can give somewhat good result. However, since I had found that he is Crazy, I decided to escape from his madness and took another way.
And then, here I finished the first RELAX NG Compact Syntax (RNC) parser implementation for Mono. Now it is in cvs. Related files are in mcs/class/Commons.Xml.Relaxng.Rnc/ directory.
So what is RELAX NG Compact Syntax? It enables you to write RELAX NG grammar in very short way. For example, when you write the 130 lines of RELAX NG "pattern" definition markup into this 11 lines (you can check Appendix A of the spec that how it is specified):
pattern =
element element { (nameQName | nameClass), (common & pattern+) }
| element attribute { (nameQName | nameClass), (common & pattern?) }
| element group|interleave|choice|optional
|zeroOrMore|oneOrMore|list|mixed { common & pattern+ }
| element ref|parentRef { nameNCName, common }
| element empty|notAllowed|text { common }
| element data { type, param*, (common & exceptPattern?) }
| element value { commonAttributes, type?, xsd:string }
| element externalRef { href, common }
| element grammar { common & grammarContent* }
Doesn't it look fascinating? ;-) We already support primitive XML Schema datatypes, so many XML Schema users won't have SoBig problem to immigrate to RELAX NG world. (Basically I like RELAX NG. Correctly to say, I don't like XML Schema. I can speak much ill of the spec :p)
OK, I want to flame the spec ;-) but it's not time for that. Let's go back to the new parser. The usage is simple:
Only XmlNameTable and TextRreader are required (well, currently name table is not fully used ;-). Oh, please note that it is just made, so it should contain bugs as yet.
To implement this jay-based parser, I had to ignore some of its formal description (for example, some formal syntax confuses Element and Elements, that causes not a little problem, especially for weakly-typed lexer/tokenizer code ;-). I will write about them another time.