R
Rob
Hi,
I just found out that in my xml file, if I have one
ELEMENT with an ATTRIBUTE, the XML::Simple treats the
ATTRIBUTE as an ELEMENT....so:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE site-catalog SYSTEM "xml_header.dtd">
<site-catalog>
<site>
<name>VNC</name>
<header>
<date id = "2006-01-04T23:14:23">
<fullname>UNKN </fullname>
<domes>NONE</domes>
<lat>UNKN</lat>
</date>
</header>
</site>
</site-catalog>
here, the DATA:umper prints:
$VAR1 = {
'site' => {
'name' => 'VNC',
'header' => {
'date' => {
'lat' => 'UNKN',
'domes' => 'NONE',
'id' => '2006-01-04T23:14:23',
'fullname' => 'UNKN ',
}
}
}
};
But, if I have 2 ELEMENTS w/ATTRIBUTES,
<?xml version="1.0" standalone="no"?>
<!DOCTYPE site-catalog SYSTEM "xml_header.dtd">
<site-catalog>
<site>
<name>VANCOUVER</name>
<header>
<date id = "2005-10-07T10:14:30">
<fullname>UNKN </fullname>
<domes>NONE</domes>
<lat>UNKN</lat>
</date>
<date id = "2006-01-04T23:14:23">
<fullname>UNKN </fullname>
<domes>NONE</domes>
<lat>UNKN</lat>
</date>
</header>
</site>
</site-catalog>
In this case, the DATA:umper prints:
$VAR1 = {
'site' => {
'name' => 'VANCOUVER',
'header' => {
'date' => {
'2005-10-07T10:14:30' => {
'lat' => 'UNKN',
'domes' => 'NONE',
'fullname' => 'UNKN',
},
'2006-01-04T23:14:23' => {
'lat' => 'UNKN',
'domes' => 'NONE',
'fullname' => 'UNKN'
}
}
}
}
};
How can I get the XML::Simple to print like the 2nd
case if I have the xml like the first case?
....thanx for any suggestions...
--Rob
I just found out that in my xml file, if I have one
ELEMENT with an ATTRIBUTE, the XML::Simple treats the
ATTRIBUTE as an ELEMENT....so:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE site-catalog SYSTEM "xml_header.dtd">
<site-catalog>
<site>
<name>VNC</name>
<header>
<date id = "2006-01-04T23:14:23">
<fullname>UNKN </fullname>
<domes>NONE</domes>
<lat>UNKN</lat>
</date>
</header>
</site>
</site-catalog>
here, the DATA:umper prints:
$VAR1 = {
'site' => {
'name' => 'VNC',
'header' => {
'date' => {
'lat' => 'UNKN',
'domes' => 'NONE',
'id' => '2006-01-04T23:14:23',
'fullname' => 'UNKN ',
}
}
}
};
But, if I have 2 ELEMENTS w/ATTRIBUTES,
<?xml version="1.0" standalone="no"?>
<!DOCTYPE site-catalog SYSTEM "xml_header.dtd">
<site-catalog>
<site>
<name>VANCOUVER</name>
<header>
<date id = "2005-10-07T10:14:30">
<fullname>UNKN </fullname>
<domes>NONE</domes>
<lat>UNKN</lat>
</date>
<date id = "2006-01-04T23:14:23">
<fullname>UNKN </fullname>
<domes>NONE</domes>
<lat>UNKN</lat>
</date>
</header>
</site>
</site-catalog>
In this case, the DATA:umper prints:
$VAR1 = {
'site' => {
'name' => 'VANCOUVER',
'header' => {
'date' => {
'2005-10-07T10:14:30' => {
'lat' => 'UNKN',
'domes' => 'NONE',
'fullname' => 'UNKN',
},
'2006-01-04T23:14:23' => {
'lat' => 'UNKN',
'domes' => 'NONE',
'fullname' => 'UNKN'
}
}
}
}
};
How can I get the XML::Simple to print like the 2nd
case if I have the xml like the first case?
....thanx for any suggestions...
--Rob