Package org.apache.xmlbeans

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


                "<open:fragment p='q' x='y' " + open +
                    ">ab<foo>xy</foo>cd</open:fragment>" );
       
        c = navDoc( x, "t" );

        assertTrue( c.currentTokenType() == TokenType.ATTR );
    }
   
    public void testCompare ( )
        throws Exception
    {
View Full Code Here


        for ( ; ; )
        {
            Assert.assertTrue( cFrom.comparePosition( cTo ) == 0 );
            Assert.assertTrue( cFrom.isAtSamePositionAs( cTo ) );

            TokenType tt = cFrom.currentTokenType();
           
            if (tt == TokenType.ENDDOC)
            {
                break;
            }
View Full Code Here

        x = XmlObject.Factory.parse( "<a p='q' m='n'><x/><y/><z/></a>" );
        c = x.newCursor();
        c.toNextToken();
        c.toNextToken();
        Assert.assertTrue( c.currentTokenType().isAttr() );
        Assert.assertTrue( c.toPrevSibling() == false );
        Assert.assertTrue( c.currentTokenType().isAttr() );
        Assert.assertTrue( c.toNextSibling() == true );
        Assert.assertTrue( c.getName().getLocalPart().equals( "x" ) );
View Full Code Here

        c = x.newCursor();
        c.toNextToken();
        c.toNextToken();
        Assert.assertTrue( c.currentTokenType().isAttr() );
        Assert.assertTrue( c.toPrevSibling() == false );
        Assert.assertTrue( c.currentTokenType().isAttr() );
        Assert.assertTrue( c.toNextSibling() == true );
        Assert.assertTrue( c.getName().getLocalPart().equals( "x" ) );

        c.toEndDoc();
        c.toPrevToken();
View Full Code Here

        Assert.assertTrue( c.toParent() == true );
        Assert.assertTrue( c.getName().getLocalPart().equals( "a" ) );
       
        c.toEndDoc();
        Assert.assertTrue( c.toParent() == true );
        Assert.assertTrue( c.currentTokenType().isStartdoc() );
       
        x = XmlObject.Factory.parse( "<a>moo<!---->foo</a>" );
        c = x.newCursor();
        c.toStartDoc();
        c.toNextToken();
View Full Code Here

        //System.out.println("Document :: \n" + doc );
        int j = 0;
        while ( resultIter.hasNext() )
        {
            xc = (XmlCursor)resultIter.next();
            System.out.println("> " + (j++) + " >--------------------------------------< " + xc.currentTokenType());
            System.out.println( xc );
        }
        System.out.println("\n>>>Results: " + j + "    " + xpathStr + " ==========================<<<");
    xc.dispose();
    }
View Full Code Here

        //System.out.println("Document :: \n" + doc );
        int j = 0;
        while ( xc.toNextSelection() )
        {
            System.out.println("> " + (j++) + " >--------------------------------------< " + xc.currentTokenType());
            System.out.println( xc );
        }
        System.out.println("\n>>>Results: " + j + "    " + xpathStr + " ==========================<<<");
    xc.dispose();
    }
View Full Code Here

        {
            char ch = xml.charAt( i );

            if (ch == '<' && Character.isLetter( xml.charAt( i + 1 ) ) )
            {
                while (!c.currentTokenType().isStart())
                    c.toNextToken();

                Assert.assertTrue( c.currentTokenType().isStart() );
                   
                XmlLineNumber ln =
View Full Code Here

            if (ch == '<' && Character.isLetter( xml.charAt( i + 1 ) ) )
            {
                while (!c.currentTokenType().isStart())
                    c.toNextToken();

                Assert.assertTrue( c.currentTokenType().isStart() );
                   
                XmlLineNumber ln =
                    (XmlLineNumber)
                        c.getBookmark( XmlLineNumber.class );
View Full Code Here

        XmlCursor c = loadCase("test.xml");

        for ( ; ; )
        {
            // System.err.println(c.currentTokenType());
            l.add(c.currentTokenType());

            if (c.toNextToken() == TokenType.NONE)
                break;
        }
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.