Sorry tangent, but I don't have an option for it.
The other part of code where fetching data is working as expected is where xml was like:
<cmts>
<name field_name="Name">cts01nsocmo</name>
<object field_name="Nemos Object">888</object>
<vendor field_name="Vendor">xyz</vendor>
</cmts>
Which was converted as:
$VAR1 = {
'cmts' => {
'name' => {
'content' => 'cts01nsocmo',
'field_name' => 'Name'
},
'object' => {
'content' => '888',
'field_name' => 'Nemos Object'
},
'vendor' => {
'content' => 'xyz',
'field_name' => 'Vendor'
}
So basically no array and 'content' was there.
Where it is not working, xml is like:
<cmts>
<STBDSG>
<dsg>
<tag1>1</tag1>
<tag2>caSystemId</tag2>
</dsg>
<dsg>
<tag1>2</tag1>
<tag2>gaSystemId</tag2>
</dsg>
</STBDSG>
</cmts>
Which was converted as:
'cmts' => {
'STBDSG' => {
'dsg' => [
{
'tag1' => '1',
'tag2' => 'caSystemId',
},
{
'tag1' => '2',
'tag2' => 'gaSystemId',
}
]
},
Update: It seems that answer to why $xst->{cmts}{STBDSG}{dsg}[0]{tag1} is getting undef is known to either KeyAttr or forcearray (or both). I am trying to find it out from them :-) |