digitalmars.D - Compiler time XML parser ?
- =?iso-8859-1?q?Knud_S=F8rensen?= (7/7) Jan 07 2006 Since Eric Anderton posted he's compile-time regular expressions lib, I
- pragma (17/23) Jan 07 2006 Interesting concept. While I cringe at the mere thought of writing a DT...
- nick (2/4) Jan 28 2006 But perhaps you want to use a schema instead of a DTD.
- David Medlock (3/13) Feb 02 2006 Perhaps this will inspire some ideas:
Since Eric Anderton posted he's compile-time regular expressions lib, I have been thinking if it is possible to make a compiler time XML parser. The similar function to Eric lib would be to have the lib read the DTD file at compiler time and make a parser which could validate XML files. Another idea is to make a library which make it possible to write XML pages in a way so that they always is valid.
Jan 07 2006
In article <pan.2006.01.07.21.23.19.554011 sneakemail.com>, =?iso-8859-1?q?Knud_S=F8rensen?= says...Since Eric Anderton posted he's compile-time regular expressions lib, I have been thinking if it is possible to make a compiler time XML parser. The similar function to Eric lib would be to have the lib read the DTD file at compiler time and make a parser which could validate XML files.Interesting concept. While I cringe at the mere thought of writing a DTD parser (I shyed away from this when I wrote my XML parser some time ago), I can certainly see the value in this. I say: go for it! The only major problems you're going to run into is with the upper limit on mangled D symbol name lengths. This pretty much goes for any template that accepts a const char[] value as an argument: it forces a hard limitation on the size of the data set you can process. The regex engine has the regex spec on its side, as most expressions are usually very brief.Another idea is to make a library which make it possible to write XML pages in a way so that they always is valid.Sort of like a DTD aware, validating, writable DOM? Sweet. One request if I may: please adopt a strategy like I did with regex, where you have a separate compile-time and runtime portions to the DTD lib if you can. That way, people can use the runtime portion if they see the need (not to mention the runtime portion will be testable separate from the compile-time portion that merely leverages it). - EricAnderton at yahoo
Jan 07 2006
Knud Sørensen wrote:The similar function to Eric lib would be to have the lib read the DTD file at compiler time and make a parser which could validate XML files.But perhaps you want to use a schema instead of a DTD.
Jan 28 2006
Knud Sørensen wrote:Since Eric Anderton posted he's compile-time regular expressions lib, I have been thinking if it is possible to make a compiler time XML parser. The similar function to Eric lib would be to have the lib read the DTD file at compiler time and make a parser which could validate XML files. Another idea is to make a library which make it possible to write XML pages in a way so that they always is valid.Perhaps this will inspire some ideas: http://www.codeproject.com/cpp/yard-xml-parser.asp
Feb 02 2006