Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Replace XML tag names.

by ikegami (Pope)
on May 03, 2010 at 15:24 UTC ( #838132=note: print w/replies, xml ) Need Help??


in reply to Replace XML tag names.

Using an different parser:
#!/usr/bin/perl use strict; use warnings; use XML::LibXML; { my $xml = <<'__XML__'; <?xml version="1.0"?> <TOP> <SUB> <THIS>STUFF</THIS> <SOME.TYPE>T</SOME.TYPE> <SOME.OTHER.TYPE>BLAH</SOME.OTHER.TYPE> </SUB> </TOP> __XML__ my $doc = XML::LibXML->new->parse_string($xml); for ($doc->findnodes('//*')) { my $name = $_->nodeName(); $name =~ tr/.//d; $_->setNodeName($name); } print($doc->toString()); }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://838132]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2018-02-22 10:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (289 votes). Check out past polls.

    Notices?