예제 #1
0
void RouteFinder::requestFinished()
{
    //qDebug() << "Route response received from Ytv.";

    QXmlStreamReader xml(this->reply->readAll());

    //this->reply->disconnect(this, SLOT(requestFinished()));
    this->reply->deleteLater();
    this->reply = NULL;

    while (!xml.atEnd())
    {
        //qDebug() << "Reading next element";
        xml.readNext();

        QString xmlName(xml.name().toString());

        //qDebug() << "Element name: " + xmlName + " Type: " + xml.tokenString();
        if (xmlName == "ROUTE" && xml.isStartElement())
        {
            this->routes.append(parseRoute(xml));
        }
    }

    //qDebug() << "Finished processing RouteFinder";
    emit(finished());
    return;
}
예제 #2
0
        Token Lexer::xmlAtomImpl()
        {
            mark=idx;
            switch (idx[0]) {
                case 0:
                    compiler->syntaxError(lineno, SYNTAXERR_XML_EOI_IN_MARKUP);
                case '<':
                    switch (idx[1]) {
                        case '!':
                            if (idx[2] == '[' &&
                                idx[3] == 'C' &&
                                idx[4] == 'D' &&
                                idx[5] == 'A' &&
                                idx[6] == 'T' &&
                                idx[7] == 'A' &&
                                idx[8] == '[') {
                                idx += 9;
                                return xmlMarkup(T_XmlCDATA);
                            }
                            if (idx[2] == '-' && idx[3] == '-') {
                                idx += 4;
                                return xmlMarkup(T_XmlComment);
                            }
                            compiler->syntaxError(lineno, SYNTAXERR_XML_INVALID_LEFTBANG);
                            
                        case '?':
                            idx += 2;
                            return xmlMarkup(T_XmlProcessingInstruction);
                            
                        case '/':
                            idx += 2;
                            return T_XmlLeftAngleSlash;

                        default:
                            idx += 1;
                            return T_XmlLeftAngle;
                    }
                    
                case '/':
                    if (idx[1] == '>') {
                        idx += 2;
                        return T_XmlSlashRightAngle;
                    }
                    compiler->syntaxError(lineno, SYNTAXERR_XML_INVALID_SLASH);
                    
                case '>':
                    idx += 1;
                    return T_XmlRightAngle;
                    
                case '{':
                    idx += 1;
                    return T_XmlLeftBrace;
                    
                case '}':
                    idx += 1;
                    return T_XmlRightBrace;

                case '=':
                    idx += 1;
                    return T_XmlEquals;

                case ' ':
                case '\t':
                case '\r':
                case '\n':
                    return xmlWhitespace();
                    
                case '"':
                case '\'':
                    return xmlString();
                    
                default:
                    if (isXmlNameStart(idx[0]))
                        return xmlName();
                    else
                        return xmlText();
            }
        }