FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cashew.DOM

 
Post new topic   Reply to topic     Forum Index -> Mango
View previous topic :: View next topic  
Author Message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Mon Aug 09, 2004 11:44 pm    Post subject: Cashew.DOM Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger
stonecobra



Joined: 25 May 2004
Posts: 48
Location: Rough and Ready, CA

PostPosted: Tue Aug 10, 2004 10:19 am    Post subject: Re: Cashew.DOM Reply with quote

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
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Tue Aug 10, 2004 11:30 am    Post subject: Re: Cashew.DOM Reply with quote

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
View user's profile Send private message
stonecobra



Joined: 25 May 2004
Posts: 48
Location: Rough and Ready, CA

PostPosted: Tue Aug 10, 2004 12:12 pm    Post subject: Re: Cashew.DOM Reply with quote

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
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Wed Aug 11, 2004 2:12 am    Post subject: Re: Cashew.DOM Reply with quote

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
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Thu Aug 12, 2004 9:37 am    Post subject: Reply with quote

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. Smile 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
View user's profile Send private message AIM Address Yahoo Messenger
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Thu Aug 12, 2004 1:00 pm    Post subject: Reply with quote

Wow ... Looks like your taking on XPath rather than just DOM. I'll look forward to that Cool
Back to top
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Fri Aug 13, 2004 7:23 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Fri Aug 13, 2004 12:04 pm    Post subject: Reply with quote

Very sorry to hear that Chris. I do hope, whatever it is, works out okay for you ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Mango All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group