Package org.apache.xmlbeans

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


                    return ((TypeStoreUser)obj).get_store().getNamespaceForPrefix(prefix);

                XmlCursor cur = ((XmlObject)_obj).newCursor();
                if (cur != null)
                {
                    if (cur.currentTokenType() == XmlCursor.TokenType.ATTR)
                        cur.toParent();
                    try { return cur.namespaceForPrefix(prefix); }
                    finally { cur.dispose(); }
                }
            }
View Full Code Here


        extends XmlCursor.XmlBookmark
    {
        public String toString()
        {
            XmlCursor xc = this.createCursor();
            return "{Node:" + xc.currentTokenType().toString() + " " + xc.toString() + "}";
        }
    }


    //
View Full Code Here

                sb = new StringBuffer();

                sb.append( "The document is not a " );
                sb.append( QNameHelper.pretty( docElemName ) );

                if (c.currentTokenType().isStartdoc())
                    sb.append( ": no document element" );
                else
                    sb.append( ": multiple document elements" );
            }
            else
View Full Code Here

        {
            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

        {
            XmlCursor cur = _root.newCursor();
            while (count > 0)
            {
                cur.toNextToken();
                if (!cur.currentTokenType().isNamespace())
                {
                    count -= 1;
                    // System.out.println("Count: " + count + " " + cur.currentTokenType().toString() + " " + QName.pretty(cur.getName()));
                }
            }
View Full Code Here

                sb = new StringBuffer();

                sb.append( "The document is not a " );
                sb.append( QNameHelper.pretty( attrName ) );

                if (c.currentTokenType().isStartdoc())
                    sb.append( ": no attributes" );
                else
                    sb.append( ": multiple attributes" );
            }
            else
View Full Code Here

    static XmlObject getWebservicesType(URL wsDDUrl) throws DeploymentException {
        try {
            XmlObject webservicesDocumentUntyped = XmlObject.Factory.parse(wsDDUrl);
            XmlCursor cursor = webservicesDocumentUntyped.newCursor();
            try {
                if (cursor.currentTokenType() != XmlCursor.TokenType.START) {
                    while(cursor.toNextToken()  != XmlCursor.TokenType.START) {}
                }
                QName qname = cursor.getName();
                if (WebservicesDocument.type.getDocumentElementName().equals(qname)) {
                    return getJ2EEWebServices(webservicesDocumentUntyped);
View Full Code Here

        cursor.toFirstChild();

        XmlCursor cur = cursor.newCursor();

        // back up to previous start or end tag
        while (!isStartOrEnd(cur.toPrevToken())) { System.out.println("Backing up: at " + cur.currentTokenType()); }
        // then forward to first start or comment (may end up where we started)
        while (!isStartOrComment(cur.toNextToken())) { System.out.println("Advancing: at " + cur.currentTokenType()); }
        // then grab the "start" javelin annotation, and grab the start token and the first char
        // _firstToken = ((JavelinAnnotation)cur.getAnnotation(JavelinAnnotation.class)).getStartToken();
View Full Code Here

        XmlCursor cur = cursor.newCursor();

        // back up to previous start or end tag
        while (!isStartOrEnd(cur.toPrevToken())) { System.out.println("Backing up: at " + cur.currentTokenType()); }
        // then forward to first start or comment (may end up where we started)
        while (!isStartOrComment(cur.toNextToken())) { System.out.println("Advancing: at " + cur.currentTokenType()); }
        // then grab the "start" javelin annotation, and grab the start token and the first char
        // _firstToken = ((JavelinAnnotation)cur.getAnnotation(JavelinAnnotation.class)).getStartToken();

        // now peek at the end tag (it may be unplaced for the <a/> case, so use the start tag if needed
        cur.toCursor(cursor);
View Full Code Here

            XmlObject.Factory.parse(
                "<bar p='q' x='y'>ab<foo>xy</foo>cd</bar>", options );
       
        XmlCursor c = navDoc( x, "t" );

        assertTrue( c.currentTokenType() == TokenType.ATTR );

        String open = "xmlns:open='http://www.openuri.org/fragment'";
       
        x =
            XmlObject.Factory.parse(
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.