I have the following XML data:
<Item>
<AttributeSetArray>
<AttributeSet attributeSetID="1137">
<Attribute attributeID="39">
<Value>
<ValueLiteral>Dodge</ValueLiteral>
<ValueID>1943</ValueID>
</Value>
</Attribute>
<Attribute attributeID="41">
<Value>
<ValueLiteral>Viper</ValueLiteral>
<ValueID>10491</ValueID>
</Value>
</Attribute>
<Attribute attributeID="214">
<Value>
<ValueLiteral>Not Offered</ValueLiteral>
<ValueID>31488</ValueID>
</Value>
</Attribute>
it keeps going...
I'm using php5 to parse the XML with SimpleXML, I need to grab the data inside attribute id 41, which in this case is the word "viper".
Here is what I have so far:
foreach ($xml->SearchResultItemArray->SearchResultItem as $searchitem) {
$model = $searchitem->Item->AttributeSet->Attribute attributeID="39">ValueLiteral;
}
I'm not sure how to enclose the "Attribute attributeID="39" part in there....
thanks for any assistance....