Package com.volantis.mcs.xml.xpath

Examples of com.volantis.mcs.xml.xpath.XPath.selectSingleNode()


                    });

            Element policyElement = null;
            try {
                policyElement =
                        (Element) xpath.selectSingleNode(definitionsRoot);
            } catch (XPathException e) {
                throw new IllegalArgumentException("Cannot find policy " +
                        "element named " + policy);
            }
View Full Code Here


                });

        Element categoryElement = null;
        try {
            categoryElement =
                    (Element) xpath.selectSingleNode(rootElement);
        } catch (XPathException e) {
            throw new IllegalArgumentException("Cannot find category " +
                    "named " + categoryName);
        }
View Full Code Here

                        // original value can be found, if not create another
                        // and so on...
                        result = createNode((ODOMElement) parent,
                                factory,
                                elementName);
                        node = (ODOMObservable) xpath.selectSingleNode(parent);
                    }
                } else {
                    // No predicate required on this step
                    result = createNode((ODOMElement) parent,
                            factory,
View Full Code Here

        for (int i = 0; i < changedNodesXPaths.size(); i++) {
            XPath xPath = (XPath) changedNodesXPaths.get(i);

            while (xPath != null) {
                ODOMObservable o = (ODOMObservable) xPath.selectSingleNode(
                        document);

                if (o != null) {
                    if (o instanceof ODOMElement) {
                        result.add(o);
View Full Code Here

            XPath childXPath = new XPath((Element) child, namespace);

            try {
                // Does the relative path find an element in the toElement?
                ODOMElement toChild = (ODOMElement)
                        childXPath.selectSingleNode((Element) toElement);

                if (toChild != null) {
                    // Corresponding child also exists in the source element,
                    // so recursively move listeners between the two children.
                    child.moveListeners(toChild);
View Full Code Here

                                DeviceRepositorySchemaConstants.
                                POLICY_ELEMENT_NAME;
                        XPath xPath = new XPath(xPathString,
                                new Namespace[]{MCSNamespace.DEVICE});
                        policyElement = (ODOMElement)
                                xPath.selectSingleNode(event.getSource());
                    }
                    // policyElement could still be null if for example a
                    // standard element has just been added - we are not
                    // interested in this case.
                    if (policyElement != null) {
View Full Code Here

                                new Namespace[] {
                                    Namespace.getNamespace(
                                                "a",
                                                context.getNamespaceURI())});
        try {
            descendant = (Element) xpath.selectSingleNode(context);
        } catch (XPathException e) {
            EclipseCommonPlugin.handleError(ABPlugin.getDefault(), e);
        }
        return descendant;
    }
View Full Code Here

        SAXBuilder builder = new SAXBuilder();

        // Make sure we create the DOM with default LPDM namespace
        builder.setFactory(new LPDMODOMFactory());

        return (ODOMElement)xpath.selectSingleNode(
            builder.build(new StringReader(xml)).getRootElement());
    }
}

/*
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.