perlquestion
rovf
<blockquote><i>
</i></blockquote>
<p>
I have a hash representing an XML structure, where a part of it basically looks like this (I've simplified it a bit):
<code>
...
arr => {
elem => [
{
mod => 'mstring1',
rp => 'rstring1',
subarr => {
subelem => [
{...}, {...}, ...
]
}
},
{
mod => 'mstring2',
rp => 'rstring2',
subarr => {
subelem => [
{...}, {...}, ...
]
}
},
}
...
</code>
This structure has been processed by XMLin, using the option <c>forcearray => [ qw(arr subarr) ]</c>. Currently, I'm writing out this structure without any options. XMLout produces the following structure on output:
<c>
...
<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>
...
</c>
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.
<c>
...
<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>
...
</c>
Can this be done with XMLout, or is XML::Simple too, eh, simple for this task?
</p>
<div class="pmsig"><div class="pmsig-683288">
-- <br>
Ronald Fischer <ynnor@mm.st>
</div></div>