Package org.apache.xmlbeans

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


        //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


        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

            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

                        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

                TTypes[] types = definitions.getTypesArray();
                for (int i = 0; i < types.length; i++) {
                    TTypes type = types[i];
                    XmlCursor typeCursor = type.newCursor();
                    try {
                        if (typeCursor.toChild(SCHEMA_QNAME)) {
                            do {
                                SchemaDocument.Schema schema = (SchemaDocument.Schema) typeCursor.getObject();
                                rewriteSchema(schema, contextURI, key);
                            } while (typeCursor.toNextSibling(SCHEMA_QNAME));
                        }
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

            if (SchemaConversionUtils.findNestedElement(rawCursor, "web-app")) {
                XmlObject webPlan = rawCursor.getObject().copy();

                XmlCursor cursor = webPlan.newCursor();
                cursor.push();
                if (cursor.toChild(GENERIC_CONFIG_QNAME)) {
                    XmlCursor source = cursor.newCursor();
                    cursor.push();
                    cursor.toEndToken();
                    cursor.toNextToken();
                    try {
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

                cursor.push();
                if (cursor.toChild(namespace, "security-realm-name")) {
                    XmlCursor other = cursor.newCursor();
                    try {
                        other.toParent();
                        if (other.toChild(SYSTEM_NAMESPACE, "gbean")) {
                            other.toPrevToken();
                        } else {
                            other.toEndToken();
                            other.toPrevToken();
                        }
View Full Code Here

        System.out.println(request);
        GetResourcePropertyResponseDocument response = broker.getResourceProperty(null, request);
        System.out.println(response);
        assertNotNull(response);
        XmlCursor cursor = response.newCursor();
        cursor.toChild(property);
        cursor.toFirstContentToken();
        assertEquals("false", cursor.getTextValue());
    }
   
    public void XtestSendNotify() throws Exception {
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.