Package org.apache.xmlbeans

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


            if (x == null)
                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


        while ( !(c.isContainer() || c.isAttr()) )
            if (c.toPrevToken().isNone())
                break;

        XmlObject x = c.getObject();
        c.pop();
        if (x == null)
            throw new IllegalStateException("getObject returned null - content must have changed");
        return x;
    }
View Full Code Here

        c.push();
        c.toNextToken();
        c.push();
        c.toNextToken();
        Assert.assertTrue( c.isAttr() );
        c.pop();
        Assert.assertTrue( c.isStart() );
        c.pop();
        Assert.assertTrue( c.isStartdoc() );
    }
   
View Full Code Here

        c.push();
        c.toNextToken();
        Assert.assertTrue( c.isAttr() );
        c.pop();
        Assert.assertTrue( c.isStart() );
        c.pop();
        Assert.assertTrue( c.isStartdoc() );
    }
   
    public void testImplicitNamespaces ( )
        throws Exception
View Full Code Here

                    //from moveable to cursor
                    moveable.moveXml(cursor);
                    while (moveable.toNextSibling(SchemaConversionUtils.J2EE_NAMESPACE, "config-property")) {
                        moveable.moveXml(cursor);
                    }
                    moveable.pop();
                    moveable.toNextSibling(SchemaConversionUtils.J2EE_NAMESPACE, "connectionfactory-interface");
                    moveable.moveXml(cursor);
                    moveable.toNextSibling(SchemaConversionUtils.J2EE_NAMESPACE, "connectionfactory-impl-class");
                    moveable.moveXml(cursor);
                    moveable.toNextSibling(SchemaConversionUtils.J2EE_NAMESPACE, "connection-interface");
View Full Code Here

        XmlCursor cursor = rawPlan.newCursor();
        try {
            if (findNestedElement(cursor, desiredElement)) {
                cursor.push();
                convertToGeronimoSubSchemas(cursor);
                cursor.pop();
                XmlObject temp = cursor.getObject();

                XmlObject result = temp.changeType(desiredType);
                if (result == null || result.schemaType() != desiredType) {
                    result = temp.copy().changeType(desiredType);
View Full Code Here

                    //from moveable to cursor
                    moveable.moveXml(cursor);
                    while (moveable.toNextSibling(J2EE_NAMESPACE, "config-property")) {
                        moveable.moveXml(cursor);
                    }
                    moveable.pop();
                    moveable.toNextSibling(J2EE_NAMESPACE, "connectionfactory-interface");
                    moveable.moveXml(cursor);
                    moveable.toNextSibling(J2EE_NAMESPACE, "connectionfactory-impl-class");
                    moveable.moveXml(cursor);
                    moveable.toNextSibling(J2EE_NAMESPACE, "connection-interface");
View Full Code Here

    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()) {
            // Element has simple content
            if (completed) {
                return new SimpleContent(schema, TypeInferrer.getBlankType());
View Full Code Here

        cursor.push();
        if (cursor.toParent() && cursor.toFirstChild()) {
            // Element has children
            cursor.pop();
            return new SequenceContent(schema, completed);
        } else if (cursor.pop() && !cursor.isEnd()) {
            // Element has simple content
            if (completed) {
                return new SimpleContent(schema, TypeInferrer.getBlankType());
            } else {
                return new SimpleContent(schema, cursor.getTextValue());
View Full Code Here

                    break;
                }
                if (orderSet.contains(qname)) {
                    if (!orderSet.get(orderSet.size() - 1).equals(qname)) {
                        // Same element occurs more an once but not in a sequence!
                        cursor.pop();
                        throw new XmlException("Same element occurs multiple times in sequence!");
                    }
                } else {
                    orderSet.add(qname);
                }
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.