RE: Standard means to convert text to XML?
I doubt very much that PHP is a regular language, so regex (even with the non-regular extras found in Perl and the like) won't suffice to create the abstract syntax tree you would require for cross language translations, syntax aware editing, or anything that requires more than lexing. On the other hand, if want to do is pretty print some source code on a web page, the conversation at http://weblogs.mozillazine.org/weirdal/archives/015930.html and http://weblogs.mozillazine.org/weirdal/archives/015932.html leads to http://dean.edwards.name/my/examples/star-light/ which is regex based. Pete -----Original Message----- From: Brett Zamir [mailto:brettz9@y...] Sent: 15 August 2007 10:04 To: xml-dev@l... Subject: Re: Standard means to convert text to XML? Hello, thanks for all your responses... It is not so much specific tools that I'm interested in, but rather a W3C standard which might be implemented in browsers like Firefox, etc. It sounds like XSLT 2.0 might be the closest thing. To give an example usage, I imagine if PHP wanted to provide some kind of regular expressions stylesheet to express the syntax of PHP, they could just post it at their own site (assuming an open means was offered to them or they developed it themselves). Then, one could take some sample PHP code (saved as a regular text file that is) and attach to it a stylesheet which had the simpler task of say producing syntax-colored HTML output of the PHP code. I've even wondered whether one could perform crude PHP <-> Java, etc. translations in this way (I know, I know, computer languages such as these are vastly different, but I think it could be a lot easier to attempt if XML were used as the medium of exchange...) Brett This email and any files attached are intended for the addressee and may contain information of a confidential nature. If you are not the intended recipient, be aware that this email was sent to you in error and you should not disclose, distribute, print, copy or make other use of this email or its attachments. Such actions, in fact, may be unlawful. In compliance with the various Regulations and Acts, General Dynamics United Kingdom Limited reserves the right to monitor (and examine for viruses) all emails and email attachments, both inbound and outbound. Email communications and their attachments may not be secure or error- or virus-free and the company does not accept liability or responsibility for such matters or the consequences thereof. General Dynamics United Kingdom Limited, Registered Office: 100 New Bridge Street, London EC4V 6JA. Registered in England and Wales No: 1911653.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
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