标题:QT的xml dom是否支持xpath那样的解析?
作者:newhappy
日期:2006-08-09 13:24
内容:
elementsByTagName
函数是否支持xxx/bbb/ccc....这样的xpath解析规则?
似乎老出错!没有获得我想要的fuck字符窜!
xml src:
child0
child1
child3
child4
fuck
world
go
str = "hello/a";
QDomElementxRoot =m_xDocPtr ->documentElement();
QDomNodeList xList = xRoot.elementsByTagName( str );
QMessageBox::information( 0, tr( "hello" ),tr( "%1" ).arg( xList.count() ) );
QMessageBox::information( 0, tr( "hello ch cnt" ),tr( "%1" ).arg( xList.at( 0 ).childNodes().count() ) );
return static_cast( &xList.at( 0 ) ) ->text();