Examples of toPrevToken()


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

                    if (currentText.trim().length() == 0)
                    {
                        // Empty text node, remove.
                        removeToken(curs);
                        curs.toPrevToken();
                    }
                    else if (previousText == null)
                    {
                        // No previous text node, reset to trimmed version
                        previousText = currentText;
View Full Code Here

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

                    {
                        // It appears that this case never happens with XBeans.
                        // Previous text node exists, concatenate
                        String newText = previousText + currentText;

                        curs.toPrevToken();
                        removeToken(curs);
                        removeToken(curs);
                        curs.insertChars(newText);
                    }
                }
View Full Code Here

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

            sourceCurs.toNextToken();

            // To hold the text.
            sourceCurs.insertChars(xmlStr);

            sourceCurs.toPrevToken();

            // Call us again with the cursor.
            moveSrcToDest(sourceCurs, curs, true);
        }
    }
View Full Code Here

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

        private int distanceToRoot()
        {
            XmlCursor cur = _impl.newCursor();
            int count = 0;
            while (!cur.toPrevToken().isNone())
            {
                if (!cur.currentTokenType().isNamespace())
                {
                    count += 1;
                    // System.out.println("Count: " + count + " " + cur.currentTokenType().toString() + " " + QName.pretty(cur.getName()));
View Full Code Here

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

        cursor.toFirstChild();

        XmlCursor cur = cursor.newCursor();

        // back up to previous start or end tag
        while (!isStartOrEnd(cur.toPrevToken())) { System.out.println("Backing up: at " + cur.currentTokenType()); }
        // then forward to first start or comment (may end up where we started)
        while (!isStartOrComment(cur.toNextToken())) { System.out.println("Advancing: at " + cur.currentTokenType()); }
        // then grab the "start" javelin annotation, and grab the start token and the first char
        // _firstToken = ((JavelinAnnotation)cur.getAnnotation(JavelinAnnotation.class)).getStartToken();
View Full Code Here

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

        XmlCursor c = x.newCursor();

        c.toNextToken();
        c.insertElement( "foo", "http://p.com" );
        c.toPrevToken();
        c.insertNamespace( "p", "http://p.com" );

        Assert.assertTrue(
            x.xmlText().equals( "<p:foo xmlns:p=\"http://p.com\"/>" ) );
    }
View Full Code Here

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

        c.toNextToken();
        c.toNextToken();
       
        c.setBookmark( a2 );
       
        c.toPrevToken();
        c.toPrevToken();

        Assert.assertEquals( c.getBookmark( TestBookmark.class ), a1 );
       
        c.toNextToken();
View Full Code Here

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

        c.toNextToken();
       
        c.setBookmark( a2 );
       
        c.toPrevToken();
        c.toPrevToken();

        Assert.assertEquals( c.getBookmark( TestBookmark.class ), a1 );
       
        c.toNextToken();
        c.toNextToken();
View Full Code Here

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

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

        XmlObject x = c.getObject();
        c.pop();
        if (x == null)
View Full Code Here

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

        for ( int i = l.size() - 1 ; ; i-- )
        {
            // System.err.println(c.currentTokenType());
            Assert.assertEquals(l.get(i), c.currentTokenType());

            if (c.toPrevToken() == 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.