Package org.apache.xmlbeans

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


        }
        // Copy the content into the XmlAttributeType
        XmlCursor loginCursor = lcDoc.newCursor();
        loginCursor.toFirstContentToken();
        XmlCursor destination = config.newCursor();
        destination.toNextToken();
        loginCursor.moveXml(destination);
        loginCursor.dispose();
        destination.dispose();
        config.setName("LoginModuleConfiguration");
        root.setServiceArray(new AbstractServiceType[]{realm});
View Full Code Here


        XmlCursor xCursor = parentXBean.newCursor();
        if ( xCursor.toLastChild() )
        {
            xCursor.toEndToken();
        }
        xCursor.toNextToken();
        childXBean = getRootElement( childXBean );
        xCursor.insertElement( getName( childXBean ) );
        xCursor.toPrevSibling();
        xCursor.getObject().set( childXBean );
        xCursor.dispose();
View Full Code Here

        XmlCursor xCursor = parentXBean.newCursor();
        if ( xCursor.toLastChild() )
        {
            xCursor.toEndToken();
        }
        xCursor.toNextToken();
        xCursor.insertElement( childName );
        xCursor.toPrevSibling();
        XmlObject childXBean = xCursor.getObject();
        xCursor.dispose();
        return childXBean;       
View Full Code Here

        private XmlObject objectAtDistance(int count)
        {
            XmlCursor cur = _root.newCursor();
            while (count > 0)
            {
                cur.toNextToken();
                if (!cur.currentTokenType().isNamespace())
                {
                    count -= 1;
                    // System.out.println("Count: " + count + " " + cur.currentTokenType().toString() + " " + QName.pretty(cur.getName()));
                }
View Full Code Here

        XmlOptions options = new XmlOptions().setDocumentType(schemaType());

        XmlObject x = XmlObject.Factory.newInstance( options );

        XmlCursor c = x.newCursor();
        c.toNextToken();
        c.insertChars( value );

        return x;
    }
View Full Code Here

            XmlObject obj = c.getObject();

            if (obj != null)
                obj.validate();

            if (c.toNextToken().isNone())
                break;
        }

        // invalid
View Full Code Here

                null, null );

        Assert.assertTrue( ! x.validate() );

        c = x.newCursor();
        c.toNextToken();
        c.toNextToken();

        Assert.assertTrue( ! c.getObject().validate() );

        // No schema
View Full Code Here

        Assert.assertTrue( ! x.validate() );

        c = x.newCursor();
        c.toNextToken();
        c.toNextToken();

        Assert.assertTrue( ! c.getObject().validate() );

        // No schema
View Full Code Here

            XmlObject obj = c.getObject();

            if (obj != null)
                obj.validate();

            if (c.toNextToken().isNone())
                break;
        }
    }

    public void testValidate6 ( )
View Full Code Here

                while (!cur.isStart()) {
                    if (cur.isEnddoc()) {
                        return cx.evaluateString
                            (scope, "<></>", "<script>", 1, null);
                    }
                    cur.toNextToken();
                }
                xo = cur.getObject();
                Object wxo = Context.javaToJS (xo, scope);
                return cx.newObject (scope, "XML", new Object[] { wxo });
            } catch (SAXException e) {
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.