Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlCursor.toChild()


            for (int j = 0; j < ports.length; j++) {
                TPort port = ports[j];
                if (port.getName().trim().equals(portComponentName)) {
                    XmlCursor portCursor = port.newCursor();
                    try {
                        if (portCursor.toChild(ADDRESS_QNAME)) {
                            if (servletLocation == null) {
                                String original = portCursor.getAttributeText(LOCATION_QNAME);
                                URI originalURI = new URI(original);
                                servletLocation = originalURI.getPath();
                            }
View Full Code Here


        //Above code inserts gbean using xsi:type=dep:GBeanType.  We also need to account for the substitution group
        //by changing the qname:
        XmlCursor gbeanCursor = root.newCursor();
        try {
            if (!gbeanCursor.toChild(ServiceDocument.type.getDocumentElementName())) {
                throw new RuntimeException("Could not find service element");
            }
            gbeanCursor.setName(GBEAN_QNAME);
        } finally {
            gbeanCursor.dispose();
View Full Code Here

        String emptyResponse = buildEmptyMessage(soapVersion, context);
        try {
            XmlObject xmlObject = XmlUtils.createXmlObject(emptyResponse);
            XmlCursor cursor = xmlObject.newCursor();

            if (cursor.toChild(soapVersion.getEnvelopeQName()) && cursor.toChild(soapVersion.getBodyQName())) {
                SchemaType faultType = soapVersion.getFaultType();
                Node bodyNode = cursor.getDomNode();
                Document dom = XmlUtils.parseXml(generator.createSample(faultType));
                bodyNode.appendChild(bodyNode.getOwnerDocument().importNode(dom.getDocumentElement(), true));
            }
View Full Code Here

        String emptyResponse = buildEmptyMessage(soapVersion, context);
        try {
            XmlObject xmlObject = XmlUtils.createXmlObject(emptyResponse);
            XmlCursor cursor = xmlObject.newCursor();

            if (cursor.toChild(soapVersion.getEnvelopeQName()) && cursor.toChild(soapVersion.getBodyQName())) {
                SchemaType faultType = soapVersion.getFaultType();
                Node bodyNode = cursor.getDomNode();
                Document dom = XmlUtils.parseXml(generator.createSample(faultType));
                bodyNode.appendChild(bodyNode.getOwnerDocument().importNode(dom.getDocumentElement(), true));
            }
View Full Code Here

            if (!xc.isContainer())
                return EMPTY_RESULT;

            List result = new ArrayList();

            if (xc.toChild(elementName))
            {
                // look for elements
                do
                {
                    result.add(xc.getObject());
View Full Code Here

        GerLoginConfigType loginConfig = (GerLoginConfigType) xmlObject.copy().changeType(GerLoginConfigType.type);
        XmlCursor xmlCursor = loginConfig.newCursor();
        xmlCursor.push();
        try {
            //munge xml
            if (xmlCursor.toChild(LOGIN_MODULE_QNAME)) {
                do {
                    xmlCursor.removeAttribute(SERVER_SIDE_QNAME);
                } while (xmlCursor.toNextSibling(LOGIN_MODULE_QNAME));
            }
            xmlCursor.pop();
View Full Code Here

                        XmlCursor source = cursor.newCursor();
                        cursor.push();
                        cursor.toEndToken();
                        cursor.toNextToken();
                        try {
                            if (source.toChild(configNamespace, element)) {
                                source.copyXmlContents(cursor);
                            }

                        } finally {
                            source.dispose();
View Full Code Here

            for (int j = 0; j < ports.length; j++) {
                TPort port = ports[j];
                if (port.getName().trim().equals(portComponentName)) {
                    XmlCursor portCursor = port.newCursor();
                    try {
                        if (portCursor.toChild(ADDRESS_QNAME)) {
                            if (servletLocation == null) {
                                String original = portCursor.getAttributeText(LOCATION_QNAME);
                                URI originalURI = new URI(original);
                                servletLocation = originalURI.getPath();
                            }
View Full Code Here

                            source.toCursor(cursor);
                        }
                        cursor.push();
                        cursor.toEndToken();
                        cursor.toNextToken();
                        if (source.toChild(PRINCIPAL_QNAME)) {
                            do {
                                source.removeAttribute(DESIGNATED_RUN_AS);
                                source.copyXml(cursor);
                            } while (source.toNextSibling(PRINCIPAL_QNAME));
                        }
View Full Code Here

        //Above code inserts gbean using xsi:type=dep:GBeanType.  We also need to account for the substitution group
        //by changing the qname:
        XmlCursor gbeanCursor = root.newCursor();
        try {
            if (!gbeanCursor.toChild(ServiceDocument.type.getDocumentElementName())) {
                throw new RuntimeException("Could not find service element");
            }
            gbeanCursor.setName(GBEAN_QNAME);
        } finally {
            gbeanCursor.dispose();
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.