Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Replace XML tag names.

by Jenda (Abbot)
on May 04, 2010 at 11:25 UTC ( [id://838285]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $xml =~ s{(?:(<!\[CDATA\[.*?\]\]>)|(<[^\s?!>]+))}{ 
      $1 or do {(my $tagname = $2 ) =~ tr/.//d;$tagname;} }seg;
    ...
    $xml =~ s{<(?:(!\[CDATA\[.*?\]\]>)|(<[^\s?!>\.]+\.[^\s?!>]+))}{
      '<'. ($1 or do {(my $tagname = $2 ) =~ tr/.//d;$tagname;} ) }seg;
    
  2. or download this
    my $XML = <<'__XML__';
    <?xml version="1.0"?>
    ...
           one: 10 wallclock secs ( 9.53 usr +  0.00 sys =  9.53 CPU) @ 10
    +492.08/s (n=100000)
         three:  2 wallclock secs ( 1.86 usr +  0.00 sys =  1.86 CPU) @ 53
    +792.36/s (n=100000)
           two:  6 wallclock secs ( 6.27 usr +  0.00 sys =  6.27 CPU) @ 15
    +959.14/s (n=100000)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://838285]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-28 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found