Nice work.

Here's a jsFiddle demo of your class, using an RSS feed as the XML.

    http://jsfiddle.net/sanford/dasYL/3/

Initial feedback:

·  There's  no reason to assume an XML response will have 'xml' in the
path,  so  it  should  not  be appended unconditionally.  I think it's
quite  safe  to assume that users of your class will know the full URL
to their data!  (I worked around this by making you append 'xml' after
the hash, neutralizing it.)

· <Marker title="marker title" lat="10" lng="20" html="HTML to display
inside an InfoWindow" /> -- hmm, you can't reasonably embed HTML in an
attribute.  You use a CDATA element for embedding X(HT)ML inside XML.

·  I'm  not *overwhelmingly* convinced that this class, as generically
presented,  is useful.  You're converting to a JS object with a fixed,
XML-document-like format, which means it will only work if you have an
API  that  knows  how  to  interpret that format.  I doubt most people
would  adapt  their  classes  to accept such deep and complex objects.
Better,  perhaps, to allow users to provide a map/template between DOM
document and JS object notation, so that incoming valid XML (which you
presumably can't alter) can be transformed into the best-fit JS object
for the class(es) to which it will be passed.

-- Sandy

Reply via email to