Re: [xml] does libxml support namespace completely?


hi there!
i have a question about the namespace! now i use the libxml process a xml file
with the
namespace, but it can't work well.
my xml file is:


i invoke the xmlGetPath(ptr),the ptr is the node pointer to the
    ,and the returen is
    but when i invoke the xpath api to fetch the node pointer with above
    path,it return the null.
    who can tell me why? and if the libxml can't support the namespace completely.

It just happend to me too. You have to register a namespace and use this for the
xpath query to work. You can leave you document as it is.

  if((ctxt=xmlXPathNewContext(elements->doc))) {
    if(!xmlXPathRegisterNs(ctxt,"q","";)) {

then use 'q' as the namespace in your query.

      \|/            Stefan Kost
     <@ @>           private            business
+-oOO-(_)-OOo------------------------------------------------------ - - -  -   -
|       __  Address  Simildenstr. 5     HTWK Leipzig, Fb IMN, Postfach 300066
|      ///           04277 Leipzig      04277 Leipzig
| __  ///            Germany            Germany
| \\\///    Phone    +49341 2253538     +49341 30766101
|  \__/     EMail    st_kost gmx net    kost imn htwk-leipzig de
|           WWW
===-=-=--=---=---------------------------------- - - -  -    -

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