in reply to XML::Twig and twig_roots - Accessing Individual XML Elements

My problem is that I'm unable to access the individual STOCK_CODE, WHOLESALE_PRICE, MAP_Price, and DISC elements within the XML document.

That's exactly what your initial code did. The thing is, you don't want them individually, you want to access those elements of each product as a group (judging by your second program). As such, the element you are really interested in is the product element. Since that's exactly what your second program does, it's indeed a perfectly fine solution.

  • Comment on Re: XML::Twig and twig_roots - Accessing Individual XML Elements

Replies are listed 'Best First'.
Re^2: XML::Twig and twig_roots - Accessing Individual XML Elements
by jbush82 (Novice) on Mar 23, 2010 at 14:37 UTC

    You're right, thank you for clearing that up, as I'm sure it may have caused some confusion saying that I needed to access those elements when I already was.