P
Page
I have some XML that I read in and print out using Data:umper which
has helped me tremendously, but I'm struggling with some parts of it.
Here is the sample Dumper output:
$VAR1 = {
'detail' => [
{
'table' => [
{
'tr' => [
{
'td' => [
{
'content' => '2316692',
'form' => '$',
'm' => '1',
'type' => 'red'
},
' ',
' ',
' '
]
}
],
'tt' => [
'Daily'
],
etc...
The problem is when I try to loop through the table. Sometimes the
child is a tt and sometimes the child is a tr and in other cases it is
a th.
How do I check to see which one it is?
for (@{$struct->{detail}->[0]->{table}}) {
# I want to now loop through all the children but do different
stuff dependinging on whether the child is a tr, tt, or th.
}
has helped me tremendously, but I'm struggling with some parts of it.
Here is the sample Dumper output:
$VAR1 = {
'detail' => [
{
'table' => [
{
'tr' => [
{
'td' => [
{
'content' => '2316692',
'form' => '$',
'm' => '1',
'type' => 'red'
},
' ',
' ',
' '
]
}
],
'tt' => [
'Daily'
],
etc...
The problem is when I try to loop through the table. Sometimes the
child is a tt and sometimes the child is a tr and in other cases it is
a th.
How do I check to see which one it is?
for (@{$struct->{detail}->[0]->{table}}) {
# I want to now loop through all the children but do different
stuff dependinging on whether the child is a tr, tt, or th.
}