{
qWarning( "Line %d, column %d: %s", exception.lineNumber( ),
exception.columnNumber( ), exception.message( ).ascii( ) );
return false;
}
bool InterceptReader::fatalError( const QXmlParseException &exception )
{
qWarning( "Line %d, column %d: %s", exception.lineNumber( ),
exception.columnNumber( ), exception.message( ).ascii( ) );
return false;
}
To copy to clipboard, switch view to plain text mode
bool InterceptReader
::startElement( const QString &namespaceURI,
{
fprintf( stderr, "start element = %s\n", qName.ascii( ) );
if( qName
== QString( "ref_event" ) ) {
mOpenElement = qName;
}
else if( qName
== QString( "dif_event" ) ) {
mOpenElement = qName;
}
return true;
}
bool InterceptReader::startElement( const QString &namespaceURI,
const QString &localName,
const QString &qName,
const QXmlAttributes &attribs )
{
fprintf( stderr, "start element = %s\n", qName.ascii( ) );
if( qName == QString( "ref_event" ) )
{
mOpenElement = qName;
}
else if( qName == QString( "dif_event" ) )
{
mOpenElement = qName;
}
return true;
}
To copy to clipboard, switch view to plain text mode
bool InterceptReader
::characters( const QString &str
) {
if( mOpenElement
== QString( "ref_event" ) ) {
mRefEventId= str;
}
else if( mOpenElement
== QString( "dif_event" ) ) {
mDiffEventId= str;
}
return true;
}
bool InterceptReader::characters( const QString &str )
{
if( mOpenElement == QString( "ref_event" ) )
{
mRefEventId= str;
}
else if( mOpenElement == QString( "dif_event" ) )
{
mDiffEventId= str;
}
return true;
}
To copy to clipboard, switch view to plain text mode
bool InterceptReader
::endElement( const QString &namespaceURI,
{
fprintf( stderr, "end element = %s\n", qName.ascii( ) );
if( qName
== QString( "ref_event" ) ) {
}
else if( qName
== QString( "dif_event" ) ) {
}
return true;
}
bool InterceptReader::endElement( const QString &namespaceURI,
const QString &localName,
const QString &qName )
{
fprintf( stderr, "end element = %s\n", qName.ascii( ) );
if( qName == QString( "ref_event" ) )
{
mOpenElement = QString( "" );
}
else if( qName == QString( "dif_event" ) )
{
mOpenElement = QString( "" );
}
return true;
}
To copy to clipboard, switch view to plain text mode
Like I said this is more of a test right now to make sure I can parse through the XML and grab certain items and later I will implement more of what I want to do with them. But this is my basic XML parser. Thanks for your continued help!
Bookmarks