cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Bukanov <i...@fastmail.fm>
Subject Re: XML support in Rhino 1.6
Date Wed, 10 Nov 2004 23:35:49 GMT
 > The implementation of E4X is based on XMLBeans,
 > http://xmlbeans.apache.org/. After having browsed the Rhino source
 > http://lxr.mozilla.org/mozilla/source/js/rhino/, I get the impression
 > that objects in the XML (whithin Rhino) class both can be constructed on
 > and return its internal o.a.xmlbeans.XmlObject. If this is true have a
 > lot of flexiblity.

If you have an instance of org.apache.xmlbeans.XmlObject you can pass it 
to XML constructor to get E4X wrapper around it. To get XmlObject from 
E4X wrapper use getXmlObject of E4X objects. Note that was added after 
RC3 for Rhino 1.6 which is what effectively in cocoondev svn repository. 
So one can have:

var xmlObject = Packages.org.apache.xmlbeans.XmlObject.Factory.parse(....)

var xml = XML(xmlObject);

xml.@SOME_ATTRIBUTE = value


var xmlObject2 = xml.getXmlObject();

// Must print true
java.lang.System.out.println(xmlObject === xmlObject2);



Regards, Igor

Mime
View raw message