Login Register

XML dataset?

I have a large intranet I've built using Adobe's Spry to read in XML files which populate many sections of the website. I'd like to figure out how to use Dojo to do the same thing, but for the life of me, I'm stumped. I've been to the site several times now, and can't find a clue as to how to go about getting started.

I did get Dojo installed, and got a lightbox gallery working - which works great and was pretty easy - but I need to do some "real" data work now, and simply can't figure out where to start.

I watched 1.5 hour presentation yesterday with 2 of the Dojo staff at Fidelity, and was very inspired to give the site another try, but I simply can't find anything on how to do this. I must be looking in the wrong place or asking the wrong question.

Here is what I do now:
- Export data from Excel to XML
- Put XML on webserver
- Use Spry to create a dataset from the XML
- Use Spry loops to read the data and conditionally print it to the screen

I essentially am using Excel as a database for a flat file style home-grown CMS system. I'd like to recreate the same functionality with Dojo, where I have Dojo create a dataset from the XML file, and conditonally output it to the screen.

Can this be done??

Doug

It depends on what you're really doing.

You can look into dojo.data, which has a number of different stores that are set up for reading and using specific kinds of data; the stores are located either in dojo/data or dojox/data (I seem to remember there was an XML one in dojox/data).

For outputting to the screen, you have a few options:

1) use some of the widgets (either in Dijit or in DojoX) for displaying said data. If you're looking for editable table output, take a look at dojox/grid.
2) if you're using the data as actual content, you might want to take a look at dojox/dtl; it's a 1:1 implementation of the Django Template Language that can be used on the client side for a templating system.

Hope that helps get you started.

regards

XmlStore

XmlStore from dojox is an option, however in my experience with it (which was isolated solely to using it with a grid) I had a difficult time getting the default version to work with deeply nested XML. So if you want to implement your own DataStore, that is a possibility. However if what you are really asking about has to do with the mechanics of parsing XML into JavaScript objects so they can be used on the page, I have done a combination of dojo.xhr to retrieve the data as XML and dojo.query which can be used for XML parsing as of 1.2. This would cover the "Use Spry to Create Datasets" portion of what you are trying to do I believe. Once you have the data as a JavaScript object the possibilities are limitless with Dojo. If you work at Fidelity and want more advice or help you can contact me directly through company email as I support Dojo @Fidelity.

Mike Addesa