Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject.xmlText()


       
        //
       
        x = XmlObject.Factory.parse( "<foo>abcdef</foo>" );
       
        Assert.assertTrue( x.xmlText().equals( "<foo>abcdef</foo>" ) );

        //
       
        x = XmlObject.Factory.parse( "<foo>a&lt;b&amp;c</foo>" );
       
View Full Code Here


        //
       
        x = XmlObject.Factory.parse( "<foo>a&lt;b&amp;c</foo>" );
       
        Assert.assertTrue( x.xmlText().equals( "<foo>a&lt;b&amp;c</foo>" ) );

        //
       
        x = XmlObject.Factory.parse( "<foo></foo>" );
       
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>" ) );

        //
       
        x = XmlObject.Factory.parse( "<foo><boo>bar</boo></foo>" );
       
View Full Code Here

        c.insertElement( "b" );
        c.toPrevSibling();
        Assert.assertTrue( c.getName().getLocalPart().equals( "b" ) );
        Assert.assertTrue( c.getName().getNamespaceURI().length() == 0 );
       
        x = XmlObject.Factory.parse( x.xmlText() );
       
        c = x.newCursor();
       
        c.toFirstContentToken();
        c.toFirstContentToken();
View Full Code Here

       
        c.toNextToken();
       
        c.insertChars( "Eric" );

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

        //

        x = XmlObject.Factory.newInstance();
View Full Code Here

        c.toNextToken();

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

        //

        x = XmlObject.Factory.newInstance();
View Full Code Here

        c.toNextToken();

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

        x = XmlObject.Factory.newInstance();
View Full Code Here

        c.toNextToken();

        c.insertElement( "foo" );
        c.insertElement( "bar" );
       
        testTextFrag( x.xmlText(), "<foo/><bar/>" );
    }
   
    public void testLoad ( )
        throws Exception
    {
View Full Code Here

    {
        XmlObject x = XmlObject.Factory.parse( "<foo/>" );
        XmlCursor c = x.newCursor();
        c.toNextToken();
        c.setAttributeText( new QName( null, "x" ), "hardehar" );
        Assert.assertTrue( x.xmlText().equals( "<foo x=\"hardehar\"/>" ) );
    }
   
    public void testNavigation ( )
        throws Exception
    {
View Full Code Here

        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\"/>" ) );
    }

    private void dotestParser ( String xml, String xmlResult )
        throws Exception
    {
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.