Cannot retrieve attributes via getData
Brought to you by:
bs_php,
nigelswinson
From: Tim S. <ti...@di...> - 2002-06-20 11:52:59
|
Hello, with version 3.0 beta I downloaded today, I cannot retrieve attributes via getData: ================================================================ tim@server:/www/xml>cat test.php <?php require_once('XPath.class.php'); $xmlstring = '<bookmark id="1"><name>Google</name></bookmark>'; $xml = new XPath(); $xml->importFromString($xmlstring); echo 'getData: ' . $xml->getData('/bookmark[1]/attribute::id') . "\n"; echo 'getData: ' . $xml->getData('/bookmark[1]/@id') . "\n"; echo 'getAttributes: ' . $xml->getAttributes('/bookmark[1]', 'id') . "\n"; ?> tim@server:/www/xml>php -q test.php getData: getData: getAttributes: 1 ================================================================ Am I doing something wrong, or is this already fixed? A note to developers: How about putting a $Version:$ into XPath.class.php so that we can determine the CVS version of the file even if we didn't get it through CVS? Thanks in advance, Tim -- ------------------------------------------------------- Tim Strehle Development Digital Collections Phone: +49 40 235 35 0 Hammerbrookstr. 93 Fax: +49 40 235 35 180 20097 Hamburg / Germany http://www.digicol.com ------------------------------------------------------- |