Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
As I said, I know it's breaking the rules, so it's technically not W3C XML, but it's what XML::Simple end's up outputting and calling XML, so I don't know what to do about it.

I have a data structure like this:
{ 'uid' => { '1' => ['3','4','5','6'], '2' => ['4','3','1','5'], }, 'did' => { '1' => '2', '3' => ['1','2'], '4' => ['1','2'], '5' => ['1','2'], '6' => '1', }, }

When I run XMLout() from XML::Simple on that structure, I get:
<opt> <did 1="2" 6="1"> <3>1</3> <3>2</3> <4>1</4> <4>2</4> <5>1</5> <5>2</5> </did> <uid> <1>3</1> <1>4</1> <1>5</1> <1>6</1> <2>4</2> <2>3</2> <2>1</2> <2>5</2> </uid> </opt>


So how can I fix it? I'm open to just about anything here including alternative storage systems, but XMLin() won't read what XMLout() outputs. Is there a way to trick XML::Parser (or expat or whatever it's called) into thinking <1>234</1> is valid?



"Weird things happen, get used to it."

Flame ~ Lead Programmer: GMS


In reply to Re: &bull;Re: XML::Parser and Invalid XML by Flame
in thread XML::Parser and Invalid XML by Flame

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2021-09-23 17:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?