[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Need xml dir list by dc:title

Subject: RE: Need xml dir list by dc:title
From: Américo Albuquerque <melinor@xxxxxxx>
Date: Tue, 22 Jul 2003 17:09:55 +0100
xml dir
Hi.

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> hgadm@xxxxxxxxxxxxx
> Sent: Tuesday, July 22, 2003 3:21 PM
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Need xml dir list by dc:title
> 
> 
> Dear all,
> 
> I want to provide a (dynamically generated) HTML page
> with links to all XML files in a given directory.
> 
> The links should however not named by the xml file name
> but with the <dc:title> element of these xml files.
> 
> I've got a nice solution with cocoon using the 
> XPathFileGenerator, but I cannot run Cocoon in the current 
> environment so I would need a pure XML/XSL solution.
> 
> Any help is greatly appreciated !
> 
> -Holger
> 

You'll need to create a xml file with the files in your directory. The way
you create this file depends on your system
One possible file format could be:
<?xml version="1.0"?>
<dir>
  <file name="file1.xml"/>
  <file name="file2.xml"/>
  ...
  <file name="fileN.xml"/>
</dir>

Then you'll apply this stylesheet:

<xsl:template match="dir">
 <P>Some discription</P>
 <xsl:apply-templates select="file"/>
</xsl:template>

<xsl:template match="file">
 <a href="{@name}"><xsl:value-of
select="document(@name)/root/dc:title"/></a><br/>
</xsl:template>

Heach fileX.xml will have the following format:
<?xml version="1.0"?>
<root xmlns:dc="some namespace definition">
  <dc:title>title</dc:title>
  ...
</root>

Hope this helps you.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.