Ok, after fighting through some late problems, it looks like I've gotten
through the first iteration.  I'm posting to the dev list first because it
probably isn't ready for public consumption.

Here is a link where you can grab JSDigester v.1, the client-side
Javascript-based implementation of Commons Digester...

http://www.omnytex.com/jsdigester.zip

Just unzip it and load up viewme.html.  It creates a relatively simple
object graph using four rules: ObjectCreateRule, SetPropertiesRule,
BeanPropertySetterRule and SetNextRule (that last one was a bit of a
pain!).  Other rules can be added later.

I've tried to comment the heck out of it, so I don't think anyone will
have much trouble understanding it.  Here's a quick explanation of the
files included...

viewme.html is just a test/sample usage page.  All the action takes place
in the doit() function, so that's what you'll be interested in.

jsdigester.js obviously contains all the JSDigester code itself, including
the four rules.

logging.js is a quick logging implementation I threw together to help with
this.  It should look a bit like JCL.  There are two implementations, one
that logs messages to alert() popups, another that writes to an element on
the page (usually a <div>) named DivLogOut.  That's the one that is used
here.

sax.js is the simple SAX parser from Mozillas' JSLib extension library. 
I'm reasonably sure the MPL is compatible with the ASF, but if there is
any interest in moving this into the ASF we'll obviosly need an answer
from someone who knows what they are talking about :)

mytypes.js are the "classes" that make up the sample object graph.  Should
be rather self-explanatory.

I've tried not to veer too far from the real Digester in terms of how it
works, so it should look very familiar externally.  Internally though, I
only glanced at the real Digester code a handful of times, otherwise it is
a fairly "clean-room" implementation (many things wouldn't make sense in
Javascript anyway, so there was little point in trying to duplicate the
code verbatim).

At this point, I'm interested in any comments.  Is this worth anything to
anyone (besides me)?  Anyone have thoughts on what the next step(s) should
be (if any)?  Thanks all!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to