Package org.apache.bsf.xml

Examples of org.apache.bsf.xml.XMLHelper


    public void testE4X() throws ScriptException, XMLStreamException, FactoryConfigurationError {
        // The default Rhino implementation provided by Java 1.6 does not support E4X,
        // so use the unique name supported by the 1.6R7 version factory.
        ScriptEngine engine = new ScriptEngineManager().getEngineByName("rhino-nonjdk");
        assertNotNull("engine should not be null",engine);
        XMLHelper convertor = XMLHelper.getArgHelper(engine);
        Object o = convertor.toScriptXML(createOMElement("<a><b>petra</b></a>"));
        OMElement om = convertor.toOMElement(o);
        assertEquals("<a><b>petra</b></a>", om.toString());

        Bindings bindings = engine.createBindings();
        bindings.put("o", o);
        Object x = engine.eval("typeof o", bindings);
View Full Code Here


//    assertEquals("<foo><b>petra</b></foo>", omOut.toString());
//  }
 
  public void testE4X() throws ScriptException, XMLStreamException, FactoryConfigurationError {
        ScriptEngine engine = new ScriptEngineManager().getEngineByExtension("js");
        XMLHelper convertor = XMLHelper.getArgHelper(engine);
        Object o = convertor.toScriptXML(createOMElement("<a><b>petra</b></a>"));
        OMElement om = convertor.toOMElement(o);
        assertEquals("<a><b>petra</b></a>", om.toString());
       
        Bindings bindings = engine.createBindings();
        bindings.put("o", o);
        Object x = engine.eval("typeof o", bindings);
View Full Code Here

TOP

Related Classes of org.apache.bsf.xml.XMLHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.