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

Re: A data structure for XML generation

by ctilmes (Priest)
on Aug 12, 2009 at 17:45 UTC ( #787993=note: print w/ replies, xml ) Need Help??


in reply to A data structure for XML generation

It would complicate your parsing a bit, but I think you could have an even simpler format by omitting an extra layer of array for sibling nodes (just use them for children). The structure translation would still be unambiguous.

[ family => { name => 'Kawasaki' }, [ father => 'Yasushisa' , mother => { hair => 'short'} => 'Chizuko' , children => [ girl => 'Shiori', boy => { hair => 'black' } => 'Yasuke', boy => 'Kairi' ] ] ]
<family name="Kawasaki"> <father>Yasuhisa</father> <mother hair="short">Chizuko</mother> <children> <girl>Shiori</girl> <boy hair="black">Yusuke</boy> <boy>Kairi</boy> </children> </family>


Comment on Re: A data structure for XML generation
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2014-12-25 18:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (161 votes), past polls