0
Ich muss diese XML mit Seife generieren, aber ich kann nicht herausfinden, eine verschachtelte XML mit Attributen zu erstellen.php verschachtelte Seife xml mit Attributen
Ich bin in der Lage dieses
<ns1:SelectedSupplements>
<ns1:SupplementInfo suppId="16" supTotalPrice="0.00" suppType="4" />
<ns1:SupplementInfo suppId="1000615" supTotalPrice="360.00" suppType="8" />
</ns1:SelectedSupplements>
zu tun, aber nicht diese
<ns1:SelectedSupplements>
<ns1:SupplementInfo suppId="16" supTotalPrice="0.00" suppType="4" />
<ns1:SupplementInfo suppId="1000615" supTotalPrice="360.00" suppType="8">
<ns1:SupAgeGroup>
<ns1:SuppAges suppFrom="1" suppTo="7" suppQuantity="1" suppPrice="40.00"/>
<ns1:SuppAges suppFrom="8" suppTo="99" suppQuantity="2" suppPrice="80.00"/>
</ns1:SupAgeGroup>
</ns1:SupplementInfo>
</ns1:SelectedSupplements>
Dies ist mein Code für das erste xml
$room_class = new stdClass();
$supplement = array();
foreach($results["hotels"]["hotel"][0]["options"]["option"][$key]["fees"]["fee"] as $one_supp)
{
array_push($supplement, array("suppId"=> $one_supp["suppId"] , "supTotalPrice" => $one_supp["amt"] , "suppType" => $one_supp["supptType"]));
}
$room_class->SelectedSupplements = $supplement;
Es erstellt verschachtelte XML mit Attributen, aber es erstellt nicht die doppelten Elemente SupplementInfo und SuppAges –