Package org.apache.xpath.objects

Examples of org.apache.xpath.objects.XNodeSetForDOM


        dbf.setNamespaceAware(true);
        dbf.setValidating(false);
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document d = db.newDocument();
        Element root = d.createElement("root");
        XNodeSetForDOM xo = (XNodeSetForDOM) XObjectFactory.create(root, xpathContext);
        Assert.assertEquals(root, xo.object());

    }
View Full Code Here


                        if ( currNode.getNodeType() == Node.ELEMENT_NODE ) {
                            nodeVector.addElement( currNode);
                        }
                    }
                    JSTLNodeList jstlNodeList = new JSTLNodeList( nodeVector);
                    newXObject = new XNodeSetForDOM( jstlNodeList, xctxt );
                   
                    return newXObject;
                  
                }
                if ( Class.forName(
        "org.apache.taglibs.standard.tag.common.xml.JSTLNodeList").isInstance(
                     varObject) ) {
                    JSTLNodeList jstlNodeList = (JSTLNodeList)varObject;
                    if  ( ( jstlNodeList.getLength() == 1 ) &&
   (!Class.forName("org.w3c.dom.Node").isInstance( jstlNodeList.elementAt(0) ) ) ) {
                        varObject = jstlNodeList.elementAt(0);
                        //Now we need to allow this primitive type to be coverted
                        // to type which Xalan XPath understands
                    } else {
                        return new XNodeSetForDOM jstlNodeList ,xctxt );
                    }
                }
                if (Class.forName("org.w3c.dom.Node").isInstance( varObject)) {
                    newXObject = new XNodeSetForDOM ( new JSTLNodeList( (Node)varObject ),xctxt );
                } else if ( Class.forName("java.lang.String").isInstance( varObject)){
                    newXObject = new XString ( (String)varObject );
                } else if ( Class.forName("java.lang.Boolean").isInstance( varObject) ) {
                    newXObject = new XBoolean ( (Boolean)varObject );
                } else if ( Class.forName("java.lang.Number").isInstance( varObject) ) {
View Full Code Here

                        if ( currNode.getNodeType() == Node.ELEMENT_NODE ) {
                            nodeVector.addElement( currNode);
                        }
                    }
                    JSTLNodeList jstlNodeList = new JSTLNodeList( nodeVector);
                    newXObject = new XNodeSetForDOM( jstlNodeList, xctxt );
                   
                    return newXObject;
                  
                }
                if ( Class.forName(
        "org.apache.taglibs.standard.tag.common.xml.JSTLNodeList").isInstance(
                     varObject) ) {
                    JSTLNodeList jstlNodeList = (JSTLNodeList)varObject;
                    if  ( ( jstlNodeList.getLength() == 1 ) &&
   (!Class.forName("org.w3c.dom.Node").isInstance( jstlNodeList.elementAt(0) ) ) ) {
                        varObject = jstlNodeList.elementAt(0);
                        //Now we need to allow this primitive type to be coverted
                        // to type which Xalan XPath understands
                    } else {
                        return new XNodeSetForDOM jstlNodeList ,xctxt );
                    }
                }
                if (Class.forName("org.w3c.dom.Node").isInstance( varObject)) {
                    newXObject = new XNodeSetForDOM ( new JSTLNodeList( (Node)varObject ),xctxt );
                } else if ( Class.forName("java.lang.String").isInstance( varObject)){
                    newXObject = new XString ( (String)varObject );
                } else if ( Class.forName("java.lang.Boolean").isInstance( varObject) ) {
                    newXObject = new XBoolean ( (Boolean)varObject );
                } else if ( Class.forName("java.lang.Number").isInstance( varObject) ) {
View Full Code Here

TOP

Related Classes of org.apache.xpath.objects.XNodeSetForDOM

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.