lunalu
12-01-2008, 02:54 PM
Hello all,
I am new to XSLT and have been trying to figure out a solution to the following issue...
Here is a summary of what I would like to do:
- Create an xsl file that generates links from specific entries in the xml file.
- Those links, when clicked, will open up a new browser window and display only the data for that entry in the xml file.
I have been able to create links that point to anchors within the document but that is not what I want.
Here is a cdcatalog xml file I am using as an example:
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
<cd>
<title>Greatest Hits</title>
<artist>Dolly Parton</artist>
<country>USA</country>
<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>
<cd>
<title>Still got the blues</title>
<artist>Gary Moore</artist>
<country>UK</country>
<company>Virgin records</company>
<price>10.20</price>
<year>1990</year>
</cd>
<cd>
<title>Eros</title>
<artist>Eros Ramazzotti</artist>
<country>EU</country>
<company>BMG</company>
<price>9.90</price>
<year>1997</year>
</cd>
</catalog>
What I would like to see in Xhtml is a page with a list like the one below:
* Empire Burlesque
* Hide your heart
* Greatest Hits
* Still got the blues
* Eros
..where the above are links to the specific CDs in the catalog (opened in a new browser window when the link is clicked).
For example: Clicking on "Empire Burlesque" would display a new window containing...
Empire Burlesque
Artist: Bob Dylan
Year: 1985
Price: 10.90
...and nothing else.
Any idea on how I can go about accomplishing this using xslt?
Thank you.
Regards,
Lu.
I am new to XSLT and have been trying to figure out a solution to the following issue...
Here is a summary of what I would like to do:
- Create an xsl file that generates links from specific entries in the xml file.
- Those links, when clicked, will open up a new browser window and display only the data for that entry in the xml file.
I have been able to create links that point to anchors within the document but that is not what I want.
Here is a cdcatalog xml file I am using as an example:
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
<cd>
<title>Greatest Hits</title>
<artist>Dolly Parton</artist>
<country>USA</country>
<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>
<cd>
<title>Still got the blues</title>
<artist>Gary Moore</artist>
<country>UK</country>
<company>Virgin records</company>
<price>10.20</price>
<year>1990</year>
</cd>
<cd>
<title>Eros</title>
<artist>Eros Ramazzotti</artist>
<country>EU</country>
<company>BMG</company>
<price>9.90</price>
<year>1997</year>
</cd>
</catalog>
What I would like to see in Xhtml is a page with a list like the one below:
* Empire Burlesque
* Hide your heart
* Greatest Hits
* Still got the blues
* Eros
..where the above are links to the specific CDs in the catalog (opened in a new browser window when the link is clicked).
For example: Clicking on "Empire Burlesque" would display a new window containing...
Empire Burlesque
Artist: Bob Dylan
Year: 1985
Price: 10.90
...and nothing else.
Any idea on how I can go about accomplishing this using xslt?
Thank you.
Regards,
Lu.