Package org.apache.xmlbeans

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


        cFrom = navDoc( x, "tt" );
        anno = new Anno();
        cFrom.setBookmark( anno );
        cTo = navDoc( x, "6t" );
        Assert.assertTrue( cFrom.moveXml( cTo ) );
        cFrom.insertChars( "[FROM]" );
        cTo.insertChars( "[TO]" );
        anno.createCursor().insertChars( "[ANNO]" );
       
        Assert.assertTrue( x.xmlText().equals(
            "<r>[FROM]<bar>[ANNO]<foo>abc</foo>[TO]</bar></r>" ) );
View Full Code Here


        //
       
        x = XmlObject.Factory.parse( "<foo></foo>" );
       
        cTo = navDoc( x, "dt" );
        cTo.insertChars( "&<" );
       
        Assert.assertTrue( x.xmlText().equals( "<foo>&amp;&lt;</foo>" ) );

        //
       
View Full Code Here

        StringBuffer sb = new StringBuffer();

        for ( int i = rnd( 10 ) ; i >= 0 ; i-- )
            sb.append( _chars[ rnd( _chars.length ) ] );

        c.insertChars( sb.toString() );
    }

    private void docChars ( )
    {
        _docs[ rnd( _docs.length ) ].xmlText();
View Full Code Here

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

        try
        {
            c.insertChars( "Ho ho ho" );
        }
        catch (IllegalStateException e)
        {
            return;
        }
View Full Code Here

        c = x.newCursor();
       
        c.toNextToken();
       
        c.insertChars( "Eric" );

        testTextFrag( x.xmlText(), "Eric" );

        //
View Full Code Here

        c = x.newCursor();

        c.toNextToken();

        c.insertComment( "" );
        c.insertChars( "x" );
       
        testTextFrag( x.xmlText(), "<!---->x" );

        //
View Full Code Here

        c = x.newCursor();

        c.toNextToken();

        c.insertElement( "foo" );
        c.insertChars( "x" );
       
        testTextFrag( x.xmlText(), "<foo/>x" );
       
        //
View Full Code Here

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

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

        return x;
    }

    private static XmlOptions makeInnerOptions(XmlOptions options)
View Full Code Here

        XmlObject xo = XmlObject.Factory.newInstance();

        XmlCursor cursor = xo.newCursor();
        cursor.toNextToken();
        cursor.beginElement("a");
        cursor.insertChars(text);
        cursor.dispose();

        String elementText = xo.toString();
        int begin = elementText.indexOf('>') + 1;
        int end = elementText.lastIndexOf('<');
View Full Code Here

            cursor.toNextToken();
            cursor.insertNamespace("wsmc", WSMC_NAMESPACE);

            cursor.beginElement("MakeConnection", WSMC_NAMESPACE);
            cursor.beginElement("Address", WSMC_NAMESPACE);
            cursor.insertChars(WsaUtils.getNamespace(makeConnectionRequest.getWsaConfig().getVersion())
                    + "/anonymous?id=" + uuid);

            cursor.dispose();

            cursor.dispose();
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.