[jdom-interest] ANNOUNCE: Test release of JDOM-JS Javascript binding
Matthew MacKenzie
matt at xmlglobal.com
Mon Mar 12 20:25:34 PST 2001
Wesley,
Cool idea -- have you considered writing your code to BSF so that the
bridge is available to other script languages? I have been using JDOM
from within an app using BSF for a while, but I am just using the
regular JDOM api (which is awesome, don't get me wrong....if you are a
programmer ;-)).
BSF == Bean Scripting Framework
(http://oss.software.ibm.com/developerworks/projects/bsf)
Cheers,
Matt
Wesley Biggs wrote:
> Hi all,
>
> I've been working on a bridge piece that allows JDOM XML trees to be
> manipulated from JavaScript (the Rhino language, that is) in a manner in
> keeping with traditional javascript styling.
>
> >From the README:
>
> What is it?
>
> - A lightweight bridge between the JDOM XML tree representation and
> a convenient JavaScript API for accessing and manipulating XML documents
>
> that uses standard JavaScript design patterns. XML documents are
> manipulated
> just like the DOM in HTML.
>
> Requirements
>
> - You need jdom.jar from the JDOM site, http://www.jdom.org/, and js.jar
> from
> the Rhino project, http://www.mozilla.org/rhino/. Download these two
> JAR files
> and place them in this directory.
>
> Here's an example of some javascript code that accesses an XML tree:
>
> // Display info about the second employee
> out.println( roster.employee[1].firstName )
> out.println( roster.employee[1].lastName )
> out.println( roster.employee[1]['@department'] )
>
> // Display raw XML for the first employee (could leave off the [0] for the
> same result)
> out.println( roster.employee[0]() )
>
> There's quite a bit more functionality in there, but that gives you a
> general idea of the usage, built to match the way the HTML DOM is accessed
> from JavaScript.
>
> This is a test release to solicit some feedback. I have tentatively placed
> this code (what there is of it -- it's meant to be very lightweight) in the
> org.jdom.contrib.js package.
>
> If you're interested in trying it out, check out the attached ZIP file. All
> comments appreciated.
>
> Thanks,
>
> Wes
>
>
> <<jdom-js.zip>>
> jdom-js.zip
>
> Content-Type:
>
> application/octet-stream
> Content-Encoding:
>
> base64
>
>
More information about the jdom-interest
mailing list