Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2014-12-19 15:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (85 votes), past polls