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

RE: Processing on both a document list and referenced

Subject: RE: Processing on both a document list and referenced documents
From: "Bjorndahl, Brad" <brad.bjorndahl@xxxxxxxxxxxxxxxx>
Date: Wed, 12 Mar 2008 08:53:33 -0400
RE:  Processing on both a document list and referenced
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-eac
h>
                                                        </ul>
                                                </li>
                                        </xsl:for-each>
                                </ul>
                        </body>
                </html>
        </xsl:template>
</xsl:stylesheet>

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.