Package org.apache.xmlbeans

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


        }

        XmlCursor curs = xo.newCursor();
        if (curs.currentTokenType().isStartdoc())
        {
            curs.toFirstContentToken();
        }

        if (isText)
        {
            // Move it to point to the text node
View Full Code Here


        }

        if (isText)
        {
            // Move it to point to the text node
            curs.toFirstContentToken();
        }

        XScriptAnnotation anno;
        try
        {
View Full Code Here

        XmlCursor curs = newCursor();

        if (curs.isStartdoc())
        {
            curs.toFirstContentToken();
        }

        result = curs.currentTokenType();

        curs.dispose();
View Full Code Here

            }
        }
        else
        {
            copyCurs = xo.newCursor();
            copyCurs.toFirstContentToken();
            if (cursToCopy.currentTokenType() == XmlCursor.TokenType.STARTDOC)
            {
                cursToCopy.toNextToken();
            }
           
View Full Code Here

            }

        }

        copyCurs.toStartDoc();
        copyCurs.toFirstContentToken();

        return copyCurs;
    }

    private static final int APPEND_CHILD = 1;
View Full Code Here

                }
            }
        }
        // Copy the content into the XmlAttributeType
        XmlCursor loginCursor = lcDoc.newCursor();
        loginCursor.toFirstContentToken();
        XmlCursor destination = config.newCursor();
        destination.toNextToken();
        loginCursor.moveXml(destination);
        loginCursor.dispose();
        destination.dispose();
View Full Code Here

            }

            // Add a cursor the new element and put it between its START and END
            // tokens, where new values can be inserted.
            XmlCursor namesCursor = namesElement.newCursor();
            namesCursor.toFirstContentToken();
            namesCursor.toEndToken();

            // Loop through the selections, appending the incoming <name> element's
            // value to the new <name> element's value. (Of course, this could have
            // been done with a StringBuffer, but that wouldn't show the cursor in
View Full Code Here

                    + XmlObject.class.getName());
        } else {
            context.setWriteXMLType(null);
            context.startElement(name, attributes);
            XmlCursor xCur = ((XmlObject) value).newCursor();
            if (xCur.toFirstContentToken() == XmlCursor.TokenType.START) {
                do {
                    Node n = xCur.getDomNode();
                    if (n.getNodeType() == Node.ELEMENT_NODE) {
                        context.writeDOMElement((Element) n);
                    }
View Full Code Here

       
        x = XmlObject.Factory.parse( "<a xmlns='foo'/>" );

        XmlCursor c = x.newCursor();

        c.toFirstContentToken();
        c.toFirstContentToken();

        c.insertElement( "b" );
        c.toPrevSibling();
        Assert.assertTrue( c.getName().getLocalPart().equals( "b" ) );
View Full Code Here

        x = XmlObject.Factory.parse( "<a xmlns='foo'/>" );

        XmlCursor c = x.newCursor();

        c.toFirstContentToken();
        c.toFirstContentToken();

        c.insertElement( "b" );
        c.toPrevSibling();
        Assert.assertTrue( c.getName().getLocalPart().equals( "b" ) );
        Assert.assertTrue( c.getName().getNamespaceURI().length() == 0 );
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.