Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject.selectPath()


    public boolean evaluate(Message message) throws JMSException {
        if( message instanceof TextMessage ) {
            String text = ((TextMessage)message).getText();
            try {
                XmlObject object = XmlObject.Factory.parse(text);
                XmlObject[] objects = object.selectPath(xpath);
                return object!=null && objects.length>0;                      
            } catch (Throwable e) {
                return false;
            }
           
View Full Code Here


            BytesMessage bm = (BytesMessage) message;
            byte data[] = new byte[(int) bm.getBodyLength()];
            bm.readBytes(data);
            try {
                XmlObject object = XmlObject.Factory.parse(new ByteArrayInputStream(data));
                XmlObject[] objects = object.selectPath(xpath);
                return object!=null && objects.length>0;                      
            } catch (Throwable e) {
                return false;
            }
        }           
View Full Code Here

            }

            // XmlObject xml = XmlObject.Factory.parse( response, options );
            XmlObject xml = XmlUtils.createXmlObject(response, options);
            String expandedPath = PropertyExpander.expandProperties(context, path);
            XmlObject[] items = xml.selectPath(expandedPath);
            AssertedXPathsContainer assertedXPathsContainer = (AssertedXPathsContainer) context
                    .getProperty(AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY);

            XmlObject contentObj = null;
            String expandedContent = PropertyExpander.expandProperties(context, expectedContent);
View Full Code Here

            throw new Exception("SOAP-Encoded messages not supported");
        }

        // XmlObject xml = XmlObject.Factory.parse( message );
        XmlObject xml = XmlUtils.createXmlObject(message);
        XmlObject[] msgPaths = xml.selectPath("declare namespace env='" + soapVersion.getEnvelopeNamespace() + "';"
                + "$this/env:Envelope/env:Body/env:Fault");
        if (msgPaths.length == 0) {
            return null;
        }
View Full Code Here

            Part[] faultParts = WsdlUtils.getFaultParts(bindingOperation, faultName);
            Part part = faultParts[0];

            QName elementName = part.getElementName();
            if (elementName != null) {
                XmlObject[] faultPaths = msgXml.selectPath("declare namespace env='" + soapVersion.getEnvelopeNamespace()
                        + "';" + "declare namespace ns='" + elementName.getNamespaceURI() + "';" + "//env:Fault/detail/ns:"
                        + elementName.getLocalPart());

                if (faultPaths.length == 1) {
                    return faultName;
View Full Code Here

                }
            }
            // this is not allowed by Basic Profile.. remove?
            else if (part.getTypeName() != null) {
                QName typeName = part.getTypeName();
                XmlObject[] faultPaths = msgXml.selectPath("declare namespace env='" + soapVersion.getEnvelopeNamespace()
                        + "';" + "declare namespace ns='" + typeName.getNamespaceURI() + "';" + "//env:Fault/detail/ns:"
                        + part.getName());

                if (faultPaths.length == 1) {
                    return faultName;
View Full Code Here

                // xquery?
                if (queryTabs.getSelectedIndex() == 0) {
                    objects = xmlObject.execQuery(xqueryArea.getText());
                } else {
                    objects = xmlObject.selectPath(xpathArea.getText());
                }

                StringBuffer result = new StringBuffer();
                XmlOptions options = new XmlOptions();
                options.setSaveOuter();
View Full Code Here

        XmlCursor cursor = null;
        try {
            // XmlObject xmlObject = XmlObject.Factory.parse( faultResponse );
            XmlObject xmlObject = XmlUtils.createXmlObject(faultResponse);
            XmlObject[] detail = xmlObject.selectPath("//detail");
            if (detail.length > 0) {
                cursor = detail[0].newCursor();

                cursor.toFirstContentToken();
View Full Code Here

                InterfaceDefinitionPart part = parts.get(i);
                String content = part.getContent();
                // XmlObject xml = XmlObject.Factory.parse( content );
                XmlObject xml = XmlUtils.createXmlObject(content);
                // include paths for both namespaces
                XmlObject[] paths = xml.selectPath("declare namespace wsp='" + WS_W3_POLICY_NAMESPACE + "';"
                        + "//wsp:Policy");
                List<XmlObject> listOfXmlObjcts = Arrays.asList(paths);

                XmlObject[] paths1 = xml.selectPath("declare namespace wsp='" + WS_XMLSOAP_POLICY_NAMESPACE + "';"
                        + "//wsp:Policy");
View Full Code Here

                // include paths for both namespaces
                XmlObject[] paths = xml.selectPath("declare namespace wsp='" + WS_W3_POLICY_NAMESPACE + "';"
                        + "//wsp:Policy");
                List<XmlObject> listOfXmlObjcts = Arrays.asList(paths);

                XmlObject[] paths1 = xml.selectPath("declare namespace wsp='" + WS_XMLSOAP_POLICY_NAMESPACE + "';"
                        + "//wsp:Policy");
                listOfXmlObjcts.addAll(Arrays.asList(paths1));
                paths = (XmlObject[]) listOfXmlObjcts.toArray();

                for (XmlObject obj : paths) {
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.