i'm working with an API that gives me two URLs to pull the content from.
The first one gives me a list of products but with limited information about each.
The second url, by using ?productId=1 i can pull the rest of the data about a specific product.
What i'm trying to do is to merge these two things into one, so i could easily import to a wordpress or somewhere else later on.
I've tried doing it with DOM+PHP and i couldn't get it to work, perhaps the xsl would be the better solution?
File1.svc
<products>
<product>
<product_id> 1 </product_id>
<product_name> Product 1 </product_name>
</product>
<product>
<product_id> 2 </product_id>
<product_name> Product 2 </product_name>
</product>
</products>
File2.svc?productId=1
<results>
<product product_id="1">
<price_from> 100 </price_from>
<price_to> 300 </price_to>
</product>
</results>
Result i want to export:
<products>
<product>
<product_id> 1 </product_id>
<product_name> Product 1 </product_name>
<price_from> 100 </price_from>
<price_to> 300 </price_to>
</product>
<product>
<product_id> 2 </product_id>
<product_name> Product 2 </product_name>
<price_from> 400 </price_from>
<price_to> 500 </price_to>
</product>
</products>