Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML::Simple question

Status
Not open for further replies.

mgp77

Programmer
Nov 25, 2005
52
CA
Hello,

I was wondering, is there anyway to have the XML::Simple module ignore tag attributes when reading in an XML file. Also is there anyway to tell the module to only parse out a certain subset of tags? Any and all help is greatly appreciated!

Thanks
 
From the XML::Simple documentation:
NoAttr => 1 *# in+out - handy*
When used with "XMLout()", the generated XML will contain no attributes.
All hash key/values will be represented as nested elements instead.

When used with "XMLin()", any attributes in the XML will be ignored.
For your selective tag parsing question, I'm not sure XML::Simple can do that. Depending on how complicated your XML document is, it might not be too much work to build some custom handlers for XML::parser. Otherwise, you might want to take a look at the other XML modules on CPAN and find one that will do what you want.
 
he has this same question on a number of forums.

- Kevin, perl coder unexceptional!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top