|We don't bite newbies here... much|
Trying to use XML::Smart: How do I get the attribute names of an XML element using XML::Smart?by jira0004 (Monk)
|on Nov 02, 2005 at 21:50 UTC||Need Help??|
jira0004 has asked for the
wisdom of the Perl Monks concerning the following question:
There are a variety of Perl packages for parsing and writing XML (See CPAN).
I am trying to use XML::Smart to parse and work with XML.
Here is what my source code is like right now:
$xml_element_obj = new XML::Smart( $xml_element_text, 'XML::Parser' );
Where $xml_element_text contains the XML element being parsed. Creating the new $xml_element_obj as indicated above causes the XML text in $xml_element_text to be parsed.
What I want to do next is I want to get the names of the XML element attributes out of $xml_element_obj. But, I can't figure out how to get $xml_element_obj to give me back the attribute names. I've looked at the XML::Smart documentation, but I haven't figured out yet how to use this Perl module to get the XML attribute names out of the XML element.
Does any one know how to get the names of an XML element's attributes out of an XML::Smart instance?
Regards, Peter Jirak