Package org.apache.xmlbeans

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


      XmlString xString1 = XmlString.Factory.newInstance(  );
      xString1.setStringValue( "one" );
      XmlString xString2 = XmlString.Factory.newInstance(  );
      xString2.setStringValue( "two" );
      XmlCursor xmlCursor = xString1.newCursor(  );
      xmlCursor.toPrevToken(  );
      XmlObject object = xmlCursor.getObject(  );
      xString1 = (XmlString) object.set( xString2 );
      System.out.println( xString1 );

      ResourcePropertyValueChangeNotificationDocument      resourcePropertyValueChangeNotificationDocument =
View Full Code Here


            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

                    break;
                }
            }
            else if (tt.isStart())
            {
                tt = curs.toPrevToken();
                if (tt.isEnd())
                {
                    curs.toNextToken();
                    if (!curs.toPrevSibling())
                    {
View Full Code Here

                    break;
                }
            }
            else if (tt.isComment() || tt.isProcinst())
            {
                curs.toPrevToken();
            }
            else
            {
                break;
            }
View Full Code Here

                    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

                    {
                        // 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

        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

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.