Subject: Re: Processing on both a document list and referenced documents
From: "Mark Peters" <flickrmeister@xxxxxxxxx>
Date: Wed, 12 Mar 2008 09:01:57 -0400
|
Hi Brad,
> You can put your namespace declaration for 'hdlg' on the stylesheet element only.
> I still think you should generalize your template to handle any number of levels of directories (using recursion).
I appreciate the tips. I'll adapt them.
Thanks,
Mark
On Wed, Mar 12, 2008 at 8:53 AM, Bjorndahl, Brad
<brad.bjorndahl@xxxxxxxxxxxxxxxx> wrote:
> Mark,
>
> I'm glad this works for you. I have a few comments if you don't mind.
>
> I used the term 'regression' incorrectly in my previous replies. I should have used 'recursion'.
>
> You can put your namespace declaration for 'hdlg' on the stylesheet element only.
>
> I still think you should generalize your template to handle any number of levels of directories (using recursion).
>
>
> Brad
>
>
> -----Original Message-----
> From: Mark Peters [mailto:flickrmeister@xxxxxxxxx]
>
> Sent: March 12, 2008 8:04 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: Processing on both a document list and referenced documents
>
>
>
> Hi Brad, everyone.
>
> Here's what worked for me:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
> <xsl:output method="html" indent="yes"/>
> <xsl:template match="hdlg:filesystem"
> xmlns:hdlg="http://www.hdlg.info/XML/filesystem">
> <html>
> <body>
> <ul>
> <xsl:for-each select="hdlg:folder"
> xmlns:hdlg="http://www.hdlg.info/XML/filesystem">
> <li>
> <xsl:value-of select="@url"/>
> <ul>
> <xsl:for-each select="document(hdlg:file/@url)"
> xmlns:hdlg="http://www.hdlg.info/XML/filesystem">
> <ul>
> <xsl:for-each select="topic">
> <li>
> <xsl:value-of select="title"/>
> <ul>
> <xsl:for-each select="topic">
> <li>
> <xsl:value-of select="title"/>
> <ul>
> <xsl:for-each select="topic">
> <li>
> <xsl:value-of select="title"/>
> </li>
> </xsl:for-each>
> </ul>
> </li>
> </xsl:for-each>
> </ul>
> </li>
> </xsl:for-each>
> </ul>
> </xsl:for-each>
> </ul>
> </li>
> </xsl:for-each>
> </ul>
> </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
>
>
--
Mark Peters
Senior Technical Writer
Saba Software
|