Hey,
So just having chatted with ilinsky on IRC about XMLDocument vs SDK
Document objects, and I was wondering why these objects are separate
at the SDK level?
I understand that XMLDocument objects are created at the browser
level, but I fail to see why, having done all this abstraction, we
can't then do a simple convert for the user of the SDK and therefore
unify them?
For example, currently if I'm doing a straight client side xsl
transformation from two server-side xml files, I have to:
1) Convert the SDK Document to an XMLDocument with DOMParser so it's
compatible with XSLTProcessor.transformToDocument(XMLDocument)
2) Convert the resulting XMLDocument back to an SDK Document with
ample.importNode(XMLDocument.documentElement) in order to play with
the Document in ample. (e.g. Query.append(Document))
Is there something that XMLDocuments offer that SDK Documents don't?
If not, I propose a couple of options to make this simpler for the
user:
a) Bury the XSLTProcessor (and DOMParser for that matter) and create a
wrapper object that mimics it exactly with the same parameters but
with 'Document' in place of 'XMLDocument'; or
b) Add methods for transformation and parsing into the ample object;
or
c) Allow any ample method that uses an SDK DOM object to also allow an
equivalent XMLDOM object. (Although what we'd do in the case of
return values would be very messy.)
What do you think?
Cheers,
Tudor.