Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with xsl

Status
Not open for further replies.

sydneysider

IS-IT--Management
Feb 13, 2007
1
AU
I'm xml/xsl newbie and so my question may seem a bit silly. However, here goes:

I have an xml which looks like:
<Files>
<File Date="5/02/2007">
<FileName>File1.mp3</FileName>
<DateToSort>2007/002/05 08:18:50 AM</DateToSort>
<FileDate>5/02/2007</FileDate>
<FileExt>[mp3]</FileExt>
<FileSize>5677</FileSize>
</File>
<File Date="5/02/2007">
<FileName>File1.pdf</FileName>
<DateToSort>2007/002/05 03:33:26 PM</DateToSort>
<FileDate>5/02/2007</FileDate>
<FileExt>[pdf]</FileExt>
<FileSize>182</FileSize>
</File>
<File Date="6/02/2007">
<FileName>File2.mp3</FileName>
<DateToSort>2007/002/06 08:18:50 AM</DateToSort>
<FileDate>6/02/2007</FileDate>
<FileExt>[mp3]</FileExt>
<FileSize>5677</FileSize>
</File>
<File Date="6/02/2007">
<FileName>File2.pdf</FileName>
<DateToSort>2007/002/06 03:33:26 PM</DateToSort>
<FileDate>6/02/2007</FileDate>
<FileExt>[pdf]</FileExt>
<FileSize>182</FileSize>
</File>
<File Date="7/02/2007">
<FileName>File3.mp3</FileName>
<DateToSort>2007/002/07 08:18:50 AM</DateToSort>
<FileDate>7/02/2007</FileDate>
<FileExt>[mp3]</FileExt>
<FileSize>5677</FileSize>
</File>
<File Date="7/02/2007">
<FileName>File3.pdf</FileName>
<DateToSort>2007/002/07 03:33:26 PM</DateToSort>
<FileDate>7/02/2007</FileDate>
<FileExt>[pdf]</FileExt>
<FileSize>182</FileSize>
</File>
.
.
.
</Files>

I need some help in wring an xsl to output this like
<ul>
<li />5/02/2007 - <a href="File1.pdf" target="_blank">[pdf]</a> | <a href="File1.mp3" target="_blank">[mp3]</a>
<li />6/02/2007 - <a href="File2.pdf" target="_blank">[pdf]</a> | <a href="File2.mp3" target="_blank">[mp3]</a>
<li />7/02/2007 - <a href="File3.pdf" target="_blank">[pdf]</a> | <a href="File3.mp3" target="_blank">[mp3]</a>
.
.
.
</ul>

Any help will be much appreciated.
 
This is really a very basic XSL thing that virtually any XSL tutorial will help you achieve. Take the XSL tutorial at (for example), take a stab at doing an XSL for this requirement, and show that to us for additional help.

Also, a product like Stylus Studio (available for free trial download) has a GUI, drag-and-drop 'mapper' interface for doing stylesheets that are this simple.

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top