Price an XML file
Posted: Wed Mar 22, 2006 11:23 pm
I have an XML file containing product information.
I have another XML file containing pricing for specific products.
Both XML files contain SKU information as a point of reference.
I'm trying to figure out how to go about creating this "look up" and replace
the "00.00" price amount according to the 2nd XML file due to the SKU's
being out of sequence from one XML file to the next.
--------------------------------------------------
This is the product page:
<Root>
<Page>
<Story>
<Table>
<row>
<Cell><SKU>456291</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>456225</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>456209</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
</Table>
<Table>
<row>
<Cell><SKU>574598</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>430937</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>481443</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>570194</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>484697</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>484555</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>484542</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>574590</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>484601</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>484572</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>571029</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
</Table>
</Story>
</Page>
</Root>
---------------------------------------------------
This is the XML Price Sheet:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<row>
<SKU>456209</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>574598</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>484572</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>571029</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>481443</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>456291</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>456225</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>570194</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>484697</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>484601</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>430937</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>484555</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>484542</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>574590</SKU>
<Price>259.99</Price>
</row>
</root>
-----------------------------------
I'm a bit stuck on how to even go about this. But it seems simple enough...
just out of reach for my knowledge though.
Thanks in advance!
I have another XML file containing pricing for specific products.
Both XML files contain SKU information as a point of reference.
I'm trying to figure out how to go about creating this "look up" and replace
the "00.00" price amount according to the 2nd XML file due to the SKU's
being out of sequence from one XML file to the next.
--------------------------------------------------
This is the product page:
<Root>
<Page>
<Story>
<Table>
<row>
<Cell><SKU>456291</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>456225</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>456209</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
</Table>
<Table>
<row>
<Cell><SKU>574598</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>430937</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>481443</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>570194</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>484697</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>484555</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>484542</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>574590</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>484601</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>484572</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
<row>
<Cell><SKU>571029</SKU></Cell>
<Cell><Price>00.00</Price></Cell>
</row>
</Table>
</Story>
</Page>
</Root>
---------------------------------------------------
This is the XML Price Sheet:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<row>
<SKU>456209</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>574598</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>484572</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>571029</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>481443</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>456291</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>456225</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>570194</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>484697</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>484601</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>430937</SKU>
<Price>159.99</Price>
</row>
<row>
<SKU>484555</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>484542</SKU>
<Price>259.99</Price>
</row>
<row>
<SKU>574590</SKU>
<Price>259.99</Price>
</row>
</root>
-----------------------------------
I'm a bit stuck on how to even go about this. But it seems simple enough...
just out of reach for my knowledge though.
Thanks in advance!