CPAN::Forum
XML-Twig - Explorer crashing while writing into XML
| Posted on Tue Aug 29 17:19:17 2006 by aloknath251 |
| Explorer crashing while writing into XML |
|
Hi,
I have this web page which saves data in an xml.
The web page has 3 textfields which takes input
and has a submit button.The data is saved in an XML
when pressed the submit button.
I am using CGI module for web page and XML::twig
module to save the data.
Sometimes I have observed while saving the data
the explorer crashes.If the XML is opened using explorer, its
always crashing probably while writing into it.
Can anybody point out what is wrong ?
Is there any way I can capture the exceptions ?
One more question , do I need to use any locking mechanism
while writing into the XML ?
Thanx,
Alok
my $registerFile = "Register.xml" ;
my $twig = XML::Twig->new( pretty_print => 'indented' );
$twig->parsefile( $registerFile );
#This is the code to save and write into the XML
if (pressed submit button execute this)
{
my $node = XML::Twig::Elt->new(
'User', {'name' => $usr},
XML::Twig::Elt->new( 'email' =>
$email )) ;
$node->paste( last_child => $twig->root ) ;
$twig->print_to_file( $registerFile ) ;
print "<h3> Saved Successfully !! </h3>" ;
}
|
| Direct Responses: 2860 | Write a response |
(6)
]