I have a hash representing an XML structure, where a part of it basically looks like this (I've simplified it a bit):
This structure has been processed by XMLin, using the option forcearray => [ qw(arr subarr) ]. Currently, I'm writing out this structure without any options. XMLout produces the following structure on output:... arr => { elem => [ { mod => 'mstring1', rp => 'rstring1', subarr => { subelem => [ {...}, {...}, ... ] } }, { mod => 'mstring2', rp => 'rstring2', subarr => { subelem => [ {...}, {...}, ... ] } }, } ...
In particular, mod and rp become attributes. Now my question: Is it possible to configure XMLout in a way, so that rp is turned in an attribute, but mod is turned into a element, i.e.... <arr> <elem mod="mstring1" rp="rstring1"> <subarr> <subelem>...</subelem> <subelem>...</subelem> </subarr> </elem> <elem mod="mstring2" rp="rstring2"> <subarr> <subelem>...</subelem> <subelem>...</subelem> </subarr> </elem> ... </arr> ...
Can this be done with XMLout, or is XML::Simple too, eh, simple for this task?... <arr> <elem rp="rstring1"> <mod>mstring1</mod> <subarr> <subelem>...</subelem> <subelem>...</subelem> </subarr> </elem> <elem rp="rstring2"> <mod>mstring2</mod> <subarr> <subelem>...</subelem> <subelem>...</subelem> </subarr> </elem> ... </arr> ...
In reply to XML::Simple : element vs. attribute in XMLout by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |