Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: XML::Simple and newlines

by Wonko the sane (Deacon)
on Apr 10, 2003 at 14:09 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-23 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found