Examples of toNextToken()


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

        rootCursor.beginElement("xml");

        for(int i=0; i < _items.size(); i++){
            XmlCursor xc = _items.get(i).newCursor();
            rootCursor.beginElement(_qnames.get(i));
            while(xc.toNextToken() == XmlCursor.TokenType.ATTR) {
                Node anode = xc.getDomNode();
                rootCursor.insertAttributeWithValue(anode.getLocalName(), anode.getNamespaceURI(), anode.getNodeValue());
            }
            xc.toStartDoc();
            xc.copyXmlContents(rootCursor);
View Full Code Here

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

     */
    protected static void preserveSpaces(STXstring xs) {
        String text = xs.getStringValue();
        if (text != null && (text.startsWith(" ") || text.endsWith(" "))) {
            XmlCursor c = xs.newCursor();
            c.toNextToken();
            c.insertAttributeWithValue(new QName("http://www.w3.org/XML/1998/namespace", "space"), "preserve");
            c.dispose();
        }
    }
}
View Full Code Here

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

            return true;

        boolean seenElement = false;

        XmlCursor c = newCursor();
        int token = c.toNextToken().intValue();

        try {
            LOOP: for (; ;) {
                SWITCH: switch (token) {
                    case TokenType.INT_START:
View Full Code Here

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

                        break SWITCH;

                    case TokenType.INT_TEXT:
                        if (!Locale.isWhiteSpace(c.getChars()))
                            return true;
                        token = c.toNextToken().intValue();
                        break SWITCH;

                    case TokenType.INT_NONE:
                    case TokenType.INT_ENDDOC:
                        break LOOP;
View Full Code Here

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

                        return true;

                    case TokenType.INT_END:
                    case TokenType.INT_COMMENT:
                    case TokenType.INT_PROCINST:
                        token = c.toNextToken().intValue();
                        break SWITCH;

                    case TokenType.INT_STARTDOC:
                        assert false;
                        break LOOP;
View Full Code Here

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

        XmlOptions options = new XmlOptions().setDocumentType(schemaType());

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

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

        return x;
    }
View Full Code Here

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

        private XmlObject objectAtDistance(int count)
        {
            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

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

        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)) {
                    //not a jaxrpc/j2ee 1.4 webservices document.
                    //TODO handle jaxrpc inside a jee5 webservices document.
View Full Code Here

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

     * Convert a Jetty document to a web document.
     */
    public static GerWebAppDocument convertJettyDocumentToWeb(XmlObject source) {
        XmlCursor cursor = source.newCursor();
        while(!cursor.isStart()) {
            cursor.toNextToken();
        }

        if(WRONG_NAMESPACE.equals(cursor.getName().getNamespaceURI())) {
            log.error("WAR includes a file using the old geronimo-jetty.xml format "+
                "(including namespace http://geronimo.apache.org/xml/ns/web/jetty). "+
View Full Code Here

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

     * Convert a (presumably nested) Jetty element to a web element.
     */
    public static GerWebAppType convertJettyElementToWeb(XmlObject source) {
        XmlCursor cursor = source.newCursor();
        while(!cursor.isStart()) {
            cursor.toNextToken();
        }

        if(WRONG_NAMESPACE.equals(cursor.getName().getNamespaceURI())) {
            log.error("EAR includes WAR deployment content using the old geronimo-jetty.xml format "+
                "(including namespace http://geronimo.apache.org/xml/ns/web/jetty). "+
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.