[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML Redux
John, I understand what you're trying to say: "Wouldn't it make more sense to use XML itself as the delimiter characters?"
{"field":<foo>This is a field</foo>}
And yes, I agree with you, my preference would be to go that route as well. The problem is that most JSON out there doesn't play by Doug Crockford's rules where you have a string that is formally parsed. Instead, it IS eval'd, which of course defeats the whole purpose of having a safe format, but there is probably as much malformed JSON out there as there is malformed XML (maybe more).
What this points to is that either the corresponding JSON libs would need to be adapted to properly parse XML blocks (which would be lovely, but which I'd say is about as likely as Hixie suddenly becoming an ardent XML-phile), or alternate mechanism would need to be provided that would make it clear to a JSON post-processor that the string in question is in fact legitimate XML content that can be parsed as XML after a simple regex transformation.
I wish it were different, but this is one of those cases where a small change in convention on the XML side could make it easier to identify embedded content in a consistent manner, whereas it would require significant behavioral change from a large and fairly hostile AJAX development community. In this case, the pattern /\"[Xx][Mm][Ll]\((<.*?>)\)\"/ would end up establishing the delimiters.
Kurt Cagle Member and Invited Expert XForms, HTML Working Group World Wide Web Consortium
443-837-8725 On Mon, Feb 21, 2011 at 1:17 PM, John Cowan <cowan@mercury.ccil.org> wrote: Kurt Cagle scripsit:
[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
|