Hi
I'm parsing a xml file through Saxon which generates the structure of my website in that it produces the relevant pages, however currently all my xsl:result-document code achieves is to output the title of the page and provide a link back to my index.
What I now need to achieve is to extract the details of my products from a seperate xml file as relevant, a simplified copy of that file is below the real thing contains hundreds of records (please tell me its set out OK!).
A few comments in terms of the schema, each product:
Must have:
<productid><title><price><image><desc><stock><incl ude>
May not have:
<imagelarge> (If missing don't show a link)
<features>
May have numerous:
<features> (Display all in a list>
<include> (Display in multiple categories)
The nodes to display on the page are:
Title
Image (with link if <imagelarge> is available)
Title
Price
Stock (if in stock, a link/button 'buy')
Description
Features (if available)
Please help me my shop could be making me money! Anyone like toy cars by the way? ;) I know I know I'm doomed! ANY advice greatly appreciated.
Code:
<?xml version = "1.0" encoding = "UTF-8"?>
<catalog>
<product>
<productid>0001</productid>
<title>Product 1</title>
<price>2.99</price>
<image>prod1.jpg</image>
<imagelarge>prod1x.jpg</imagelarge>
<desc>A description of product 1.</desc>
<features>Prod1 feature</features>
<features>Prod1 another feature</features>
<stock>In Stock</stock>
<include>
<category>This Category</category>
<subcategory>This Subcategory 1</subcategory>
</include>
<include>
<category>This Category</category>
<subcategory>This Subcategory 4</subcategory>
</include>
</product>
<product>
<productid>0002</productid>
<title>Product 2</title>
<price>1.99</price>
<image>prod2.jpg</image>
<imagelarge>prod2x.jpg</imagelarge>
<desc>A description of product 2.</desc>
<features>Prod2 only one feature</features>
<stock>Out of Stock</stock>
<include>
<category>That Category</category>
<subcategory>That Subcategory 3</subcategory>
</include>
</product>
</catalog>