cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Bukanov>
Subject Re: XML support in Rhino 1.6
Date Wed, 10 Nov 2004 23:36:56 GMT
 > The implementation of E4X is based on XMLBeans,
 > After having browsed the Rhino source
 >, 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 =

var xml = XML(xmlObject);

xml.@SOME_ATTRIBUTE = value

var xmlObject2 = xml.getXmlObject();

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

Regards, Igor

View raw message