xsl-list
[Top] [All Lists]

Re: [xsl] Processing on both a document list and referenced documents

2008-03-12 06:02:36
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(_dot_)bjorndahl(_at_)thermofisher(_dot_)com> 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(_at_)gmail(_dot_)com]

Sent: March 12, 2008 8:04 AM
 To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
 Subject: Re: [xsl] 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>





--~------------------------------------------------------------------
 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
 To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
 or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
 --~--





-- 

Mark Peters
Senior Technical Writer
Saba Software

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--