Connecting Tech Pros Worldwide Forums | Help | Site Map

XML::Simple Print Path of all leaf nodes

Newbie
 
Join Date: Jul 2006
Posts: 2
#1: Jul 23 '06
Is it possible to print the path of all leaf nodes of an XML using XML::Simple
This is the kind of output text that i'm trying to print (not the leaf node values but the path to reach them)

c:\> perl ListLeafs.pl config.xml

{RootNode}->{ChildNode1}->{LeafNode1}
{RootNode}->{ChildNode1}->{LeafNode2}
{RootNode}->{ChildNode1}->{LeafNode3}
{RootNode}->{ChildNode2}->{LeafNode1}
{RootNode}->{ChildNode2}->{LeafNode2}
{RootNode}->{ChildNode2}->{LeafNode3}

Reply