problems with latest version (1.3.0)

  • MatG

    MatG - 2007-05-06


    I am porting code that was previously working with
    the previous TinyXPath version. The following does
    not work anymore :

    - doing a query
    - getting back a nodeset
    - storing nodes ( using node->Clone() )
    - doing other queries on these "new" nodes

    I took a look at the code, the problem arise because
    it seems that the cloned nodes (or the ones returned
    in the nodeset ?) do not have a parent (Parent()
    returns NULL) then it raises the 'execution error'
    exception in er_compute_xpath in xpath_processor.cpp

    Before it was ok because of the "build_root" thing.

    Can someone help me please ?
    I do not know what to do.

    Thanks in advance!!!

    • Yves Berquin

      Yves Berquin - 2007-05-07

      Would you have an example of this?

      The code has been changed indeed, so that we do not touch the XML tree anymore.
      All returned nodes should still have their parent: we do not clone them anymore. We return pointers to the untouched original XML.

    • MatG

      MatG - 2007-05-07


      I think I found my problem : in fact, as you do not
      touch the XML tree and you return pointers to the
      nodes now, I do not need to clone the nodes in the
      returned nodeset after a query.

      All the returned nodes in a nodeset are valid as
      long as the XML document is there. It seems it was
      not the case before ?

      Anyway, I did a test and it's fine again :-)
      (without cloning anything !).

      Thanks :-)


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks