Re: [xml] xmllint --shell + incorrect behavior

On Tue, Sep 17, 2002 at 03:34:42PM -0700, OrangeCrush wrote:


I use the xmllint --shell print.xml (attached file) and the following
is the result.  The incorrect behavior happens after I do a cd .. to
go back to the root directory and try to cd into ADDRESSBOOK[2] which
was the result I got by doing pwd.  As you can see below that it tells
me that the node does not exist but according to pwd it does exist. Is
this the correct behavior? I traced it to function xmlGetNodePath which
is used by the pwd command.  Is it possible that this function might be
producing wrong results?

  Yes it's a bug, xmlGetNodePath() when computing the index forget to check
that a node is an element before checking for the name, and in this case
there is a preceeding sibling PI with the same name, hence the error. I knew
about it but never went to fix it, thanks for raising it again :-)

paphio:~/XML -> xmllint --shell print.xml 
/ > ls
?an        1 ADDRESSBOOK
---       17 ADDRESSBOOK
/ > 
/ > / > pwd
Unknown command /
/ > cd /
paphio:~/XML -> 

  patch enclosed,


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

Attachment: path.patch
Description: Text document

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