Output:use Data::Dump; my $price; while($reader->read) { next unless $reader->nodeType==XML_READER_TYPE_ELEMENT; dd $reader->localName, $reader->readInnerXml; $price = $reader->readInnerXml if $reader->localName eq 'price'; } dd "price", $price;
BTW your XML is broken. </buyurl> should be </url>.( "product", "\n<name>5 Spoke Wheel</name>\n<description>Reconditioned OEM</descr +iption>\n<price>123.45</price>\n<url>http://www.foo.com</url>\n<image +url>http://www.foo.com/foo.jpg</imageurl>]\n", ) ("name", "5 Spoke Wheel") ("description", "Reconditioned OEM") ("price", 123.45) ("url", "http://www.foo.com") ("imageurl", "http://www.foo.com/foo.jpg") ("price", 123.45)
In reply to Re: Assigning variables and persistence using Lib::LibXML::Reader
by Anonymous Monk
in thread Assigning variables and persistence using Lib::LibXML::Reader
by CA_Tallguy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |