[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Need xml dir list by dc:title
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|