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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl XML parser - how to exclude block of file

Status
Not open for further replies.

kmatishak

Programmer
Feb 2, 2009
1
Hi,

I've got an XML file that I run through a Perl script that uses the XML Parser. I need to be able to exclude certain blocks of XML based on one of the tag values in the block. For example, my input file has the following:

<customBucket></customBucket>
<customDimensionName>Strategy</customDimensionName>
<customBucketValueString>Test Strategy</customBucketValueString>
<customBucketEnd></customBucketEnd>
<customBucket></customBucket>

I want to be able to exclude all of the above lines in my output file based on the value of customDimensionName (eg. if the value is "Strategy", then exclude everything between and including the customBucket start/end tags)

Is there an easy way of doing this in Perl?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top