Re: [xml] xpath problem



On Wed, Mar 4, 2009 at 2:47 AM, Belgabor <belgabor gmx de> wrote:
Sounds very much like a namespace issue. Please tell exactly how you
registered it and what query you then used.

Hi,

I've changed the code a bit and the xpath expressions:

xmlDocPtr doc;
xmlXPathContextPtr context;
xmlChar *xpath;
xmlXPathObjectPtr result;

doc = xmlParseFile("prot.icd");
context = xmlXPathNewContext(doc);
xmlXPathRegisterNs(context,"ied","http://www.iec.ch/61850/2003/SCL";);
result = xmlXPathEvalExpression(xpath, context);

The expressions are:

/icd:SCL
//icd:LN[ desc="PEFN"]

These expressions evaluate good but I don't know how to write and
expression which uses absolute path
and evaluate in the given namespace or even better if I can move the
starting point of the evaluated expression in the xpath context.

Is there a way to set the starting point (the starting node) from
where the xpath will be evaluated if
relative paths are used?

TIA, Jovan



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