Package com.volantis.mcs.xml.xpath

Examples of com.volantis.mcs.xml.xpath.XPath


                    prefix = qName.substring(0, i);
                    ns = Namespace.getNamespace(prefix, namespaceURI);
                }
            }
            // work out the path from the root node to this child element
            XPath childXPath = new XPath(parentNode.getXPath(),
                    childStep,
                    new Namespace[]{ns});

            // Obtain the element by assuming that the document is
            // being parsed in document order and getting the next
View Full Code Here


                        // attribute.
                        String xPathString = "ancestor-or-self::" +
                                MCSNamespace.DEVICE.getPrefix() + ":" +
                                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

        Element identificationNode =
                    dram.retrieveDeviceIdentification(deviceName);
        return PolicyUtils.findProblemMarkers(resource,
                                              DeviceRepositorySchemaConstants.
                                                IDENTIFICATION_ELEMENT_NAME,
                                              new XPath(identificationNode));
    }
View Full Code Here

        Element identificationNode =
                    dram.retrieveDeviceTACElement(deviceName);
        return PolicyUtils.findProblemMarkers(resource,
                                              DeviceRepositorySchemaConstants.
                                              TAC_IDENTIFICATION_ELEMENT_NAME,
                                              new XPath(identificationNode));
    }
View Full Code Here

                throws CoreException {
        Element deviceElement =
                    dram.retrieveDeviceElement(deviceName);
        return PolicyUtils.findProblemMarkers(resource,
                                              deviceName,
                                              new XPath(deviceElement));
    }
View Full Code Here

        StringBuffer buffer = new StringBuffer();
        // note using "a" as the namespace prefix
        buffer.append("descendant::a:").append(name);
        // create the XPath. Bind the prefix "a" to the namespace URI that
        // the context belongs to.
        XPath xpath = new XPath(buffer.toString(),
                                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

                final boolean elementsEqual =
                    attributesEqual(elementA, elementB, identityAttributes);

                // If they are equal, mark them both as duplicates
                if (elementsEqual) {
                    duplicates[outer] = new XPath(assets[outer]);
                    duplicates[inner] = new XPath(assets[inner]);
                }
            }
        }

        // Now we just report the duplicates
View Full Code Here

                    : new Namespace[]{ns});

            // Now get the parent's xpath: if it's null, our xpath is just an
            // (absolute) path to the proxied element; otherwise, we just
            // append the name of the proxied element to the parent's xpath
            final XPath parentXPath = ((ProxyElement) parent).xpath;
            if (parentXPath == null) {
                if (ns != null) {
                    xpath = new ODOMXPath(new StringBuffer(ns.getPrefix()).
                            append(':').
                            append(details.getElementName()).
View Full Code Here

        ODOMElement resolved = NON_COLUMN;
        StringBuffer xpath = new StringBuffer(XPATH_PART_1);
        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

            // More than one element in the list means that we have
            // an element with a duplicate name.
            if (duplicates.size() > 1) {
                for (int i = 0; i < duplicates.size(); i++) {
                    Element element = (Element) duplicates.get(i);
                    ErrorDetails details = new ErrorDetails(element, new XPath(element),
                            null, FaultTypes.DUPLICATE_NAME, null, null);
                    errorReporter.reportError(details);
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.xml.xpath.XPath

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.