I need some assistance with the following issue. I have an xml file with the following structure:
<attributes>
<record ProductId="103" Compatibility="iPhone"/>
<record ProductId="103" Color="Black"/>
<record ProductId="103" Material="Leather"/>
<record ProductId="103" Collection="iPhone"/>
</attributes>
The problem is that I want to generate only one record per ProductId because it makes it easier for me to handle the information. The record should look like:
<record ProductId="103" Compatibility="iPhone" Color="Black" Material="Leather" Collection="iPhone"/>
I believe that using xpath is the way to go, but I just can't get the synthax right. I'm using a php script to parse the xml file.
Any assistance will be greatly appreciated.