[xml] xmllint --shell + incorrect behavior



Hi,

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?

Thanks,

Jasmit Singh 

/ > pwd
/
/ > ls
?an        1 ADDRESSBOOK
---       17 ADDRESSBOOK
/ > cd ADDRESSBOOK
ADDRESSBOOK > pwd
/ADDRESSBOOK[2]
ADDRESSBOOK > cd ..
/ > cd /ADDRESSBOOK[2]
/ADDRESSBOOK[2] is a 0 Node Set



Do you Yahoo!?
Yahoo! News - Today's headlines
<?xml version= '1.0'?>
<!DOCTYPE ADDRESSBOOK [
<!ELEMENT ADDRESSBOOK (PERSON)*>
<!ELEMENT PERSON (LASTNAME, FIRSTNAME, COMPANY, EMAIL, PHONE)>
<!ELEMENT LASTNAME (#PCDATA)>
<!ELEMENT FIRSTNAME (#PCDATA)>
<!ELEMENT COMPANY (#PCDATA)>
<!ELEMENT EMAIL (#PCDATA)>
<!ELEMENT PHONE (#PCDATA)>
<!ENTITY PHONENUMBER '540-552-7788'>
<!ATTLIST PERSON gender CDATA #IMPLIED>
]>
<ADDRESSBOOK>

  <!--new information-->
  <PERSON gender='male'>
    <LASTNAME>Idris</LASTNAME>
    <FIRSTNAME>Namul</FIRSTNAME>
    <COMPANY><![CDATA[<<The Bean Factory>>]]></COMPANY>
    <EMAIL>xml beanfactory com</EMAIL>
    <PHONE>&PHONENUMBER;</PHONE>
  </PERSON>

  <!--new information-->
  <PERSON gender='male'>
    <LASTNAME>Idris</LASTNAME>
    <FIRSTNAME>Namul</FIRSTNAME>
    <COMPANY><![CDATA[<<The Bean Factory>>]]></COMPANY>
    <EMAIL>xml beanfactory com</EMAIL>
    <PHONE>&PHONENUMBER;</PHONE>
  </PERSON>

  <!--new information-->
  <PERSON gender='male'>
    <LASTNAME>Idris</LASTNAME>
    <FIRSTNAME>Namul</FIRSTNAME>
    <COMPANY><![CDATA[<<The Bean Factory>>]]></COMPANY>
    <EMAIL>xml beanfactory com</EMAIL>
    <PHONE>&PHONENUMBER;</PHONE>
  </PERSON>

  <!--new information-->
  <PERSON gender='male'>
    <LASTNAME>Bart</LASTNAME>
    <FIRSTNAME>Simpson</FIRSTNAME>
    <COMPANY><![CDATA[<<The Bean Factory>>]]></COMPANY>
    <EMAIL>xml beanfactory com</EMAIL>
    <PHONE>&PHONENUMBER;</PHONE>
  </PERSON>
</ADDRESSBOOK>


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