Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: XML::Simple and newlines

by Wonko the sane (Deacon)
on Apr 10, 2003 at 14:09 UTC ( #249617=note: print w/ replies, xml ) Need Help??


in reply to XML::Simple and newlines

Your problem is that your data is being stored as an attrib.

Try the "noattr" option for XML::Simple.

#!/usr/local/bin/perl5.6.0 -w use strict; use XML::Simple; my $xs = XML::Simple->new(); my %data; $data{text} = q{ line 1 text line 2 text line 3 text }; print $xs->XMLout(\%data, noattr => 1)

Outputs:
:!./t1.pl <opt> <text> line 1 text line 2 text line 3 text </text> </opt>
The data will be preserved inside the tags, rather than as
an attrib of the tag itself.
Wonko


Comment on Re: XML::Simple and newlines
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2014-07-14 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (253 votes), past polls