Package org.apache.xmlbeans

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


                throw new IllegalStateException("getObject returned null - content must have changed");
            return x;
        }

        c.pop();
        c.push();
       
        while ( !(c.isContainer() || c.isAttr()) )
            if (c.toPrevToken().isNone())
                break;
View Full Code Here


    public void testCursorStack ( )
        throws Exception
    {
        XmlObject x = XmlObject.Factory.parse( "<foo x='y'/>" );
        XmlCursor c = x.newCursor();
        c.push();
        c.toNextToken();
        c.push();
        c.toNextToken();
        Assert.assertTrue( c.isAttr() );
        c.pop();
View Full Code Here

    {
        XmlObject x = XmlObject.Factory.parse( "<foo x='y'/>" );
        XmlCursor c = x.newCursor();
        c.push();
        c.toNextToken();
        c.push();
        c.toNextToken();
        Assert.assertTrue( c.isAttr() );
        c.pop();
        Assert.assertTrue( c.isStart() );
        c.pop();
View Full Code Here

                    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

    public static XmlObject fixGeronimoSchema(XmlObject rawPlan, QName desiredElement, SchemaType desiredType) throws XmlException {
        XmlCursor cursor = rawPlan.newCursor();
        try {
            if (findNestedElement(cursor, desiredElement)) {
                cursor.push();
                convertToGeronimoSubSchemas(cursor);
                cursor.pop();
                XmlObject temp = cursor.getObject();

                XmlObject result = temp.changeType(desiredType);
View Full Code Here

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

        return attrs;
    }

    public Content validate(Context context) throws XmlException {
        XmlCursor cursor = context.getCursor();
        cursor.push();
        if (cursor.toParent() && cursor.toFirstChild()) {
            // Element has children
            cursor.pop();
            return new SequenceContent(schema, completed);
        } else if (cursor.pop() && !cursor.isEnd()) {
View Full Code Here

        // Find element order
        List<QName> orderSet = new ArrayList<QName>();
        List<QName> orderList = new ArrayList<QName>();
        if (!cursor.isEnd()) {
            cursor.push();
            do {
                QName qname = cursor.getName();
                if (qname == null) {
                    break;
                }
View Full Code Here

        }
        // Check element order against schema
        if (validateOrder(context, orderSet) && validateOccurances(context, orderList)) {
            // Validate elements
            for (QName item : orderList) {
                cursor.push();
                particles.get(item).validate(context);
                cursor.pop();
                cursor.toNextSibling();
            }
        } else {
View Full Code Here

    }

    public Type validate(Context context) throws XmlException {
        XmlCursor cursor = context.getCursor();
        List<QName> seen = new ArrayList<QName>();
        cursor.push();
        if (!mixed && isMixed(context)) {
            // TODO: Check with ConflictHandler
            mixed = true;
        }
        cursor.pop();
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.