Hi Tom,

 

I started with the one like below:

 

#!/usr/bin/perl

 

# include package

use XML::Parser;

 

# initialize parser

$xp = new XML::Parser();

 

# set callback functions

$xp->setHandlers(Start => \&start, End => \&end, Char => \&cdata);

 

# keep track of which tag is currently being processed

$currentTag = "";

 

# parse XML

$xp->parsefile("library.xml");

 

# this is called when a start tag is found

sub start()

{

                # extract variables

                my ($parser, $name, %attr) = @_;

 

                $currentTag = lc($name);

                

  print $currentTag;

                

}

 

Regards,

rummy

 

From: tom smith [mailto:climbingpartn...@gmail.com] 
Sent: Saturday, November 07, 2009 3:58 PM
To: Ramesh, Marimuthu
Cc: beginners@perl.org
Subject: Re: Change tag case

 

 

On Sat, Nov 7, 2009 at 2:45 AM, Ramesh, Marimuthu <m.ram...@spi-bpo.com>
wrote:



Hi,



I have some 3000 sgml files, where I need to change the tag case from
upper case to lower case.



Example: Change <ART ID="IMG1">This is an image</IMG> to <art
id="IMG1">This is an image</IMG>.



Note that the tag name and the attribute name should only change and not
the values.



Can anyone help please? If it is a code for batch process, it will much
helpful.

 

 

So are you looking to hire a programmer?  Or, do you want help with a
program you are writing?   If the latter, post your code and any
specific questions you have.  Otherwise, post how much you are willing
to pay.

Reply via email to