Re: Trying to parse XML file

2004-08-23 Thread Richard Jolly
On 23 Aug 2004, at 20:29, Kevin Old wrote: Hello everyone, I'm new to parsing XML files. I've got a somewhat working attempt, but keep getting errors when certain elements are undefined. Can't call method "as_text" on an undefined value at ./xmltreebuild.pl line 33. Believe the error message! Lin

RE: Trying to parse XML file

2004-08-23 Thread Thomas, Mark - BLS CTR
> Could I use the "findnodes" subroutine you're using > above as a regular expression? The expressions in XML::LibXML and XML::XPath are XPath expressions. They are very powerful in that you can generally craft an XPath expression to get exactly what you want, making most extractions a one-liner.

RE: Trying to parse XML file

2004-08-23 Thread Thomas, Mark - BLS CTR
Your code loops around a 'product-announced' element, which doesn't exist in your file. Does that have something to do with it? Since you say you're new to XML parsing, perhaps you'd like to see an example of an alternate solution. The following is XML::LibXML code, and XML::Xpath code would be vi

Re: Trying to parse XML file

2004-08-23 Thread Kevin Old
On Mon, 23 Aug 2004 17:02:20 -0400, Thomas, Mark - BLS CTR <[EMAIL PROTECTED]> wrote: > Your code loops around a 'product-announced' element, which doesn't exist in > your file. Does that have something to do with it? > > Since you say you're new to XML parsing, perhaps you'd like to see an > exam