Package com.volantis.mcs.xml.xpath

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


                elementPath = elementPath.getParent();
            }

            // select the correct component
            context.getODOMSelectionManager()
                    .setSelection(elementPath.selectNodes(root));
            XPathFocusable[] focusableControls = getXPathFocusableControls();
            for (int i = 0; (focusableControls != null) &&
                    (i < focusableControls.length); i++) {
                focusableControls[i].setFocus(xPath);
            }
View Full Code Here


        XPath gridRows = new XPath(buffer.toString(),
                new Namespace[] { grid.getNamespace() });

        List gridRowFormats;
        try {
            gridRowFormats = gridRows.selectNodes(grid);
        } catch (XPathException e) {
            throw new UndeclaredThrowableException(e);
        }

        return gridRowFormats;
View Full Code Here

        List matches = new ArrayList();

        try {
            // Apply the XPath expression to the root of the document provided
            List nodes = xpath.selectNodes(root);

            if (nodes != null) {
                // Iterate over any nodes selected by the XPath
                for (Iterator i = nodes.iterator(); i.hasNext(); /**/) {
                    Object current = i.next();
View Full Code Here

        List matches = new ArrayList();

        try {
            // Apply the XPath expression to the root of the document provided
            List nodes = xpath.selectNodes(root);

            if (nodes != null) {
                // Iterate over the devices selected by the XPath. For each
                // device check its patterns agains the regular expression. If
                // there is a match then add the device to the list of matches.
View Full Code Here

                                                "ns",
                                                typeElement.getNamespaceURI())
                                });

        try {
            List fields = xpath.selectNodes(typeElement);
            // we must have at least one field
            if (fields.isEmpty()) {
                throw new IllegalStateException("The structure element must " +
                                                "contain at least one field");
            }
View Full Code Here

                new Namespace[]{element.getNamespace()});

        List gridRowFormats;
        try {
            gridRowFormats =
                    rowsXPath.selectNodes(element);
        } catch (XPathException e) {
            throw new UndeclaredThrowableException(e);
        }

        return gridRowFormats;
View Full Code Here

            xPathToken = tokenizer.nextToken();
            // @todo pass the namespaces on in a nicer way (e.g. have a protected constructor that takes the map and copies it)
            xpath = new XPath(xPathToken, this.getNamespacesString());

            // Check to see if the node or nodes already exist in the document.
            List nodes = xpath.selectNodes(parent);
            ODOMObservable node = null;
            if ((nodes == null) || (nodes.size() == 0)) {
                // Node wasn't found, so create one.
                ODOMObservable result = null;
                int predicateStart = xPathToken.indexOf(PREDICATE_START);
View Full Code Here

        xpath.append(index).append(XPATH_PART_2);
        xpath.append(index).append(XPATH_PART_3);

        XPath xpathResolver = new XPath(xpath.toString(), NAMESPACES);

        List resolvedElements = xpathResolver.selectNodes(element);
        if (resolvedElements != null && resolvedElements.size() > 0) {
            if (resolvedElements.size() == 1) {
                Object node = resolvedElements.get(0);
                if (node instanceof ODOMElement) {
                    resolved = (ODOMElement) node;
View Full Code Here

            String xpathStr)
            throws Exception {

        // Update is expected to work on exactly one entity
        final XPath xpath = new XPath(xpathStr);
        final List finds = xpath.selectNodes(context);
        if (finds == null) {
            throw new IllegalStateException(
                    "Found null: " + xpath.getExternalForm());
        }
        if (finds.size() != 1) {
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.