Opened 9 years ago

Closed 8 years ago

#8901 closed enhancement (wontfix)

[patch][cla] dojo.xml --> parsing for XML documents into javascript object

Reported by: David Fudge Owned by: Tom Trenka
Priority: high Milestone: tbd
Component: Dojox Version: 1.2.3
Keywords: XML, ActionScript, JS Object, XML DOM Cc:
Blocked By: Blocking:


I have started a basic package that takes in an XML DOM node (as is passed back from dojo.xhrGet/xhrPost) and returns a useable JS object that works similar to how the ActionScript? 3.0 XML interface does.

In its current state it is only dealing with node names, attributes, and values. I have not accounted for any namespaces or fancy XML stuff but I thought this would be a good start toward a package like this for Dojo.

Attachments (2)

xml.js (4.4 KB) - added by David Fudge 9 years ago.
parser.js (6.0 KB) - added by dante 9 years ago.
style review and code changes

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by David Fudge

Attachment: xml.js added


comment:1 Changed 9 years ago by dylan

Component: GeneralDojox
Owner: changed from anonymous to Adam Peller
Summary: patch: dojo.xml --> parsing for XML documents into javascript object[patch][cla] dojo.xml --> parsing for XML documents into javascript object

comment:2 Changed 9 years ago by Adam Peller

Owner: changed from Adam Peller to Tom Trenka

Changed 9 years ago by dante

Attachment: parser.js added

style review and code changes

comment:3 Changed 9 years ago by dante

@rkstar - I've reviewed and edited the file for Dojo Style guidelines (whitespace, squigles, and some simple code changes) but have a few remarks:

  • This seems to overlap substantially with dojox.xml.parser (?)
  • I've renamespaced it into dojox.xml.parse (can't just throw things in base)
  • The inline docs could be expanded
  • There needs to be tests :)

my version of the code is attached, though untested since my changes (no tests available)

comment:4 Changed 9 years ago by Tom Trenka


This code looks ok but I could have sworn that Jared had added something like this to support

comment:5 Changed 9 years ago by dante

k -- sorry for any confusion. my attached parser.xml is plain wrong, and a copy from trunk (thanks @peller) ... I did a style and namespace cleanup on the initial patch, and realized it overlapped with dojox.xml.parser and though I'd attached my work. my bad.

Either way -- the functionality seems to overlap with existing code (as seen by the 'alleged' patch) and neither dojox.xml or this patch have tests or documentation so the issue is moot. -1

comment:6 Changed 8 years ago by Tom Trenka

Resolution: wontfix
Status: newclosed

I'm going to mark this as "won't fix". There's two different ways already existing to accomplish something close to these needs: dojox.xml.DomParser?

The first will take a document and parse it for use with; the second will take an XML string and create a JSON-like structure out of it, including basic get and traversal methods.

Note: See TracTickets for help on using tickets.