Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mfrac>
- <mi>a</mi>
- <mrow>
- <mi>bcde</mi>
- </mrow>
- </mfrac>
- <msqrt>
- <mi>s</mi>
- <mi>e</mi>
- <mi>f</mi>
- </msqrt>
- </math>
- #!/usr/bin/perl
- use strict;
- use warnings 'all';
- use XML::LibXML;
- my $mediaIdFrom = "MEDIAID_TEST";
- my $VodItemIdFrom = "VODITEM_ID_TEST";
- my $mediaId="";
- my $vodItemId="";
- my $filename = 'sample1.xml';
- my $out_filename = "sample2.xml";
- my $dom = XML::LibXML -> load_xml(location => $filename);
- foreach $mediaId ($dom->findnodes('/ScheduleProvider/Episode/Media/@id')) {
- $mediaId->setValue("xx " . $mediaIdFrom . " yy");
- }
- foreach $vodItemId ($dom->findnodes('/ScheduleProvider/VoidItem/@id')) {
- $vodItemId->setValue($VodItemIdFrom);
- }
- #### for storing the output separate XML file
- $dom->toFile($out_filename);`
Add Comment
Please, Sign In to add comment