View previous topic :: View next topic |
Author |
Message |
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Mon Aug 09, 2004 11:44 pm Post subject: Cashew.DOM |
|
|
Now that Mango's XML branch is living, I'd like to go public with a supplementary library I've been envisioning for Mango. The first package I have in mind, is a DOM/3 implementation, to complement the nice SAX modules already getting into Mango proper.
I've already written interfaces for DOM3-Core (cashew.dom.model.core.*), and am about to start on DOM3-XML (cashew.dom.model.xml.*). If there is interest, I can request a new DSource project for Cashew (the oh-so-cute name of the lib), and commit the current iteration of Cashew.DOM to Subversion, so that everyone can contribute, review, edit, etc. _________________ Chris Nicholson-Sauls |
|
Back to top |
|
|
stonecobra
Joined: 25 May 2004 Posts: 48 Location: Rough and Ready, CA
|
Posted: Tue Aug 10, 2004 10:19 am Post subject: Re: Cashew.DOM |
|
|
csauls wrote: | Now that Mango's XML branch is living, I'd like to go public with a supplementary library I've been envisioning for Mango. The first package I have in mind, is a DOM/3 implementation, to complement the nice SAX modules already getting into Mango proper. |
Have you considered doing a DOM-like API that takes better advantage (is more tied to) D? I only say this because I think DOM, although standard, is one of the worst APIs in the world to actually use. MHO, of course. |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Tue Aug 10, 2004 11:30 am Post subject: Re: Cashew.DOM |
|
|
stonecobra wrote: | Have you considered doing a DOM-like API that takes better advantage (is more tied to) D? I only say this because I think DOM, although standard, is one of the worst APIs in the world to actually use. MHO, of course. |
Were you thinking along the lines of JDOM? If there were something like D-DOM that had a similar ease-of-use approach, that would be really great. I believe one could lay the standard DOM API on top of such an animal for purposes of compatability. Of course, "D-DOM" conjours up notions of older Russian symphonies: DOM, DOM, D-DOM DOM; DOM, DOM, D-DOM DOM DOM ... |
|
Back to top |
|
|
stonecobra
Joined: 25 May 2004 Posts: 48 Location: Rough and Ready, CA
|
Posted: Tue Aug 10, 2004 12:12 pm Post subject: Re: Cashew.DOM |
|
|
kris wrote: | Were you thinking along the lines of JDOM? If there were something like D-DOM that had a similar ease-of-use approach, that would be really great. |
Diddy DOM diddy DOM...
Yes, something like JDOM, DOM4J, or XOM. Anything that makes life easier for the *DOM developer. Not only ease of use, but it would also implement things like iterators, so you can foreach() stuff, etc. |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Wed Aug 11, 2004 2:12 am Post subject: Re: Cashew.DOM |
|
|
csauls wrote: | Now that Mango's XML branch is living, I'd like to go public with a supplementary library I've been envisioning for Mango. The first package I have in mind, is a DOM/3 implementation, to complement the nice SAX modules already getting into Mango proper. |
I think this would be awesome Chris. There seems to be a large contingent who don't need the perfomance aspects of SAX, or need to revisit nodes on a regular basis.
Stonecobra does have a good point about DOM not being a particularly great API though. I recall a somewhat emotional response at finally having an alternative to the horrors of the original DOM (was that the inspiration for John Carmack?). If you could find your way to supporting one of the more approachable APIs also, that would be even better! |
|
Back to top |
|
|
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Thu Aug 12, 2004 9:37 am Post subject: |
|
|
I'm not familiar with JDOM, so I may take a look at it... and I'd already started a side project (Cashew.TXML = TinyXML) that may turn into a minimal XML tree... maybe. For the most part I'm trying to follow the W3C specs as closely as possible for the model code, in the implementing classes I intend to include some shortcuts, such as using opIndex to grab attributes and child elements, and instantiating "plain jane" XML documents directly from the DomDocument class... Something like:
Code: |
// want to load "foo.xml" and get the "version" attribute of root element
IDomDocument doc = new DomDocument("foo.xml");
wchar[] fooVersion = (doc.root())["version"];
// want to load "foo.xml" and get the "bar" attribute of the second "weasle" element
IDomDocument doc = new DomDocument("foo.xml");
wchar[] bar = doc["weasle"][1]["bar"];
|
Note the second style... The idea I had was that doing element lookups by name would return an array of all matching children. This is why I'm thinking of making Cashew its own project... one man's work will probably suit one man. One obvious flaw with the idea so far, is how one grabs text without reverting to the whole business of traversing "nodes". _________________ Chris Nicholson-Sauls |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Thu Aug 12, 2004 1:00 pm Post subject: |
|
|
Wow ... Looks like your taking on XPath rather than just DOM. I'll look forward to that |
|
Back to top |
|
|
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Fri Aug 13, 2004 7:23 am Post subject: |
|
|
Due to unforeseen circumstances occurring about an hour and a half ago, I don't know when I'll be able to get back to work on Cashew -- or any of my projects. May be a while. Sorry about this. _________________ Chris Nicholson-Sauls |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Fri Aug 13, 2004 12:04 pm Post subject: |
|
|
Very sorry to hear that Chris. I do hope, whatever it is, works out okay for you ... |
|
Back to top |
|
|
|