DJpumps has asked for the wisdom of the Perl Monks concerning the following question:
See example code:
The expected output (contents of the scalar $text is the word space followed by a single space character, followed by the word tab, followed by a single tab character, followed by the word newline, followed by a single newline character, and then the word end.#!/usr/bin/perl use strict; use warnings; use XML::Twig; my $twig=XML::Twig->new(); my $xml = qq{<root t="space tab\tnewline\nend"/>}; $twig->xparse($xml); my $text=$twig->root->att('t'); print "|$text|\n";
Instead, the tab and the newline characters were replaced by a single space character each.
This relates to XML::Twig 3.29 and XML::Twig 3.30. I did not check this behavior in other versions of XML::Twig
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Twig and whitespaces
by mirod (Canon) on Aug 23, 2007 at 15:06 UTC | |
by DJpumps (Novice) on Aug 25, 2007 at 03:38 UTC | |
by mirod (Canon) on Aug 26, 2007 at 09:43 UTC | |
|
Re: XML::Twig and whitespaces
by monkey_boy (Priest) on Aug 23, 2007 at 14:49 UTC |