Package org.apache.xmlbeans

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


            "<bar>xy<foo x='y'>abcdef</foo>pqr<foo>123456</foo></bar>" );
       
        cFrom = navDoc( x, "2d" );
        cTo = navDoc( x, "2ds-2c" );
       
        Assert.assertTrue( cFrom.removeXml() );

        cFrom.insertChars( "[FROM]" );
        cTo.insertChars( "[TO]" );

        Assert.assertTrue(
View Full Code Here


        x = XmlObject.Factory.parse( "<bar><!---->abc</bar>" );
       
        cFrom = navDoc( x, "tt" );
        cTo = navDoc( x, "tttc" );
       
        Assert.assertTrue( cFrom.removeXml() );

        cFrom.insertChars( "[FROM]" );
        cTo.insertChars( "[TO]" );

        Assert.assertTrue( x.xmlText().equals( "<bar>[FROM]a[TO]bc</bar>" ) );
View Full Code Here

    public void removeXml ( )
    {
        XmlCursor c = getCursor();

        if (!c.isStartdoc() && !c.isFinish())
            c.removeXml();
    }

    public static class Bookmark extends XmlCursor.XmlBookmark
    {
    }
View Full Code Here

                    XmlCursor cursor = xo.newCursor();
                    // strip comments out, as xmlbeans doesn't
                    // seem to like them
                    do {
                        if (cursor.isComment()) {
                            cursor.removeXml();
                        }
                    } while (cursor.toNextToken() != XmlCursor.TokenType.NONE);
                    cursor.dispose();          
                    inDoc = Context.toObject(xo, scope);
                    Object[] args = {inDoc};
View Full Code Here

    * @param xBean an XMLBean
    */
   public static void remove( XmlObject xBean )
   {
      XmlCursor xCursor = xBean.newCursor(  );
      xCursor.removeXml(  );

      xCursor.dispose(  );
   }

   /**
 
View Full Code Here

      XmlCursor xCursor = xBean.newCursor(  );
      for ( boolean hasNext = xCursor.toFirstChild(  ); hasNext; hasNext = xCursor.toNextSibling(  ) )
      {
         if ( ( name == null ) || getName( xCursor ).equals( name ) )
         {
            succeeded = succeeded && xCursor.removeXml(  );
         }
      }

      xCursor.dispose(  );
      return succeeded;
View Full Code Here

                // Delete all attributes.
                if (curs.toFirstAttribute())
                {
                    while (curs.currentTokenType().isAttr())
                    {
                        curs.removeXml();
                    }
                }
            }
            else
            {
View Full Code Here

                        qname = cursor.getName();
                        String prefix = qname.getLocalPart();
                        if(prefix.equals(nsPrefix))
                        {
                            // Delete the current Namespace declaration
                            cursor.removeXml();
                            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.