[jQuery] New plugin: toXML (XML serializer)

[jQuery] New plugin: toXML (XML serializer)

Hi John,
My objections are mostly from a philosophical standpoint. Since it may
sometimes return valid xml and sometimes return a doc fragment, what can you
do with it? You can't load it in a document, you can't post it to a web
service... you'd have to manually parse it to figure out what it includes
and therefore what it could be used for. I think it could be improved if it
wrapped its results in its own root element or was renamed to
.toXmlMarkup().
Tony Collins
-----Original Message-----
From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com] On
Behalf Of John Resig
Sent: Thursday, October 05, 2006 8:20 PM
To: jQuery Discussion.
Subject: Re: [jQuery] New plugin: toXML (XML serializer)
Tony -
It's not, necessarily, implied that this plugin will return valid XML for an
entire XML Document - instead, it's returning valid XML for an XML Document
Fragment - which is perfectly "ok".
I mean, you can't expect $([ item1, item2 ]).toXML() to give you a valid XML
document - and forcefully wrapping itself seems foolhardy.
If it was so much of a concern, maybe there could be a
.toXMLDocument() which returned a valid XML document instead of just a
fragment.
--John