[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: CodeML?
From: robert sanford <rsanford@n...> >is there a specification anywhere for creating an xml based >programming language? the idea that i have in my head is that a >language would be specified in a schema describing a BNF like >structure and that potentially an XSLT could translate a "program" >(aka instance document) written in that language to an actual >implementation language such as perl, java, c++, etc. See Gavin Nicol's XEXPR http://www.w3.org/TR/xexpr/ for a scripting language using XML syntax (looks like a little LISP in XML). I have implemented XML->C/Java transformations several times, e.g. the GLUE transcoders (see http://www.ascc.net/xml/resource/glue we stopped this project because we thought it undesirable to compete with Mark Davis' ICU) and I would not recommend XSLT as the transformation language: it is too verbose and you have to make ugly code in order to get nice output. If you did decide to go with XSLT, you would do well to first create a special output handler for your target language, so that delimiting was handled transparently. One inconvenience with XSLT for this use is the space handling: it is difficult to have nicely indented XSLT code that does not introduce unwnated whitespace in the output. The bigger dificulty is the gap in traceability from error messages from the target compiler to the XML code: so you really want to make as much use of XML validators (DTDs, etc., Schematron http://www.ascc.net/xml/schematron ) as possible so that as many errors are caught on the XML side as possible. I found OmniMark (and I imaging Perl would be the same) to be much better syntax for this than XSLT. XSLT's specification notes that it was not designed as a general-purpose transformation language. 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
|