Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QXmlQuery, fail to open local xml file
Forum Updated to NodeBB v4.3 + New Features

QXmlQuery, fail to open local xml file

Scheduled Pinned Locked Moved General and Desktop
qxmlquery
1 Posts 1 Posters 458 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    marceloarguello700
    wrote on last edited by marceloarguello700
    #1

    QXmlQuery, fail to open local xml file
    Hi i need to open a local xml file and retrieve information,

    But i dont can´t.
    this is my code:

    void xmlFileRead::fileQuery(QString filename)
    			{
    				QStringList  strList;
    				QFileInfo fi(filename);
    				qDebug()<< "absPath:"<< fi.absoluteFilePath();
    				QXmlQuery query;
    				QString q=QString("doc('%1')/systems/string()").arg(fi.absoluteFilePath());
    				query.setQuery(q);
    				if (query.isValid())
    				{
    					qDebug()<< "isValid()==true:";
    					query.evaluateTo(&strList);
    				}
    
    				qDebug()<< "strList:"<< strList.count() ;
    
    			}
    

    and this mi outpup:
    absPath: "D:/shapes/98092902.xml"
    isValid()==true:
    Error FODC0002 in d:/shapes/98092902.xml: Protocol "d" is unknown,
    d is the hard drive not a protocol,
    I know that is a beginner question, but
    Why there are so few samples of QXmlQuery?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved