Re: XML Parsing in Qt 3.3
Could you show us your InterceptReader class? At least the error handling routines...
Re: XML Parsing in Qt 3.3
Code:
{
qWarning( "Line %d, column %d: %s", exception.lineNumber( ),
exception.columnNumber( ), exception.message( ).ascii( ) );
return false;
}
Code:
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;
}
Code:
bool InterceptReader
::characters( const QString &str
) {
if( mOpenElement
== QString( "ref_event" ) ) {
mRefEventId= str;
}
else if( mOpenElement
== QString( "dif_event" ) ) {
mDiffEventId= str;
}
return true;
}
Code:
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;
}
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!
Re: XML Parsing in Qt 3.3
what is reader.parse( &file ) value?
Re: XML Parsing in Qt 3.3
What do you mean by
Quote:
what is reader.parse( &file ) value?
It returns false if that is what you mean?
I have run my code through DBX and my stack's last 6 lines looks like
Code:
reader.parse( &file )
InterceptReader::fatalError
Thanks again!
[SOLVED] Re: XML Parsing in Qt 3.3
I found my problem at least as to why I got my error. My XMLs were in a different directory than my executable and when getting a QDir, using the [] operator only returned the filename and when I created the QFile I needed to make sure to include the actual path to the files when giving the filename to create the QFile. Now that I give the path/filename the files don't error out. Thanks for your help anyways!