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


            QName childName = XmlUtils.getQName( children.item( c ) );
            if( !elementName.equals( childName ) )
            {
              XmlCursor cur = paths[0].newCursor();
              cur.toParent();
              cur.toChild( childName );
              errors.add( XmlError.forCursor( "Invalid element [" + childName + "] in SOAP Body", cur ) );
              cur.dispose();
            }
          }
        }
View Full Code Here

    {
      // XmlObject xmlObject = XmlObject.Factory.parse( emptyResponse );
      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

    {
      // XmlObject xmlObject = XmlObject.Factory.parse( emptyResponse );
      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

        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

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

            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

                    cursor.toNextSibling(SchemaConversionUtils.J2EE_NAMESPACE, "resourceadapter");
                    moveable.toCursor(cursor);
                    cursor.toFirstChild();
                    cursor.beginElement("outbound-resourceadapter", SchemaConversionUtils.J2EE_NAMESPACE);
                    cursor.beginElement("connection-definition", SchemaConversionUtils.J2EE_NAMESPACE);
                    moveable.toChild(SchemaConversionUtils.J2EE_NAMESPACE, "managedconnectionfactory-class");
                    moveable.push();
                    //from moveable to cursor
                    moveable.moveXml(cursor);
                    while (moveable.toNextSibling(SchemaConversionUtils.J2EE_NAMESPACE, "config-property")) {
                        moveable.moveXml(cursor);
View Full Code Here

        // ./
        // xc.toStartDoc();
        // ./*
        xc.toNextToken();
        // ./*/timestamp
        xc.toChild(TIMESTAMP_QNAME);
        System.out.println(xc.xmlText());
        XmlCalendar calendar = new XmlCalendar(xc.getTextValue());
        // return getDateFormat().parse(xc.getTextValue()); // fixme: this
        // supports only one date format
        return calendar.getTime();
View Full Code Here

        // ./
        // xc.toStartDoc();
        // ./*
        xc.toNextToken();
        // ./*/notificationSource
        xc.toChild(NOTIFICATION_SRC_QNAME);
        // ./*/notificationSource/@*
        boolean hasAttr = xc.toFirstAttribute();
        while (hasAttr && !WF_TIMESTEP_QNAME.equals(xc.getName())) {
            hasAttr = xc.toNextAttribute();
        }
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.