[xml] xpath problem



Hi,

I'm writing a parser for IEC 61850 xml configuration files.

You can find an example file at:
ftp://ftp.areva-td.com/ICD_FILES/P43x/P439/IEC%2061850%20P439-611-202.icd

I wanted to speed up the node searches and passing the xml tree by using xpath.

I've noticed that xpath search (the xmlXPathEvalExpression function)
does not return anything
because of the root node:
<SCL xmlns="http://www.iec.ch/61850/2003/SCL";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.iec.ch/61850/2003/SCL SCL.xsd">
but when I remove all the properties of the root node (edited the xml
file) the xmlXPathEvalExpression worked good.

So I thought to remove the root node's properties programmatically by
using the xmlFreePropList but it didn't remove the properties

What am I doing wrong?

You can find my source code at
http://chombium.awardspace.com/files/misc/xpath.html
Basically its a modification of the XPath example from the Libxml
Tutorial written by John Fleck
I also tried to register the namespace, but that didn't help.

TIA, Jovan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]