xsl-list
[Top] [All Lists]

XSL count function.

2005-03-03 15:07:26
Hello,

I have a XML file (see below) with a "file" nodes and
I want to get a count of file nodes based on certain
attributes.  I am using XSLT transformations on the
XML to put them into HTML.

Here is the XML:
---------------------------------------------------
<file type="txt" path="...."/>
<file type="txt" path="...."/>
<file type="doc" path="....."/>
<file type="html" path="...."/>
---------------------------------------------------

End result I want displayed on the screen is something
like this:
---------------------------------------------------
txt files: count = 2
doc files: count = 1
html files: count = 1
total files: count = 4

How would I get this?  I can get the total file count
by using: <xsl:value-of select="count(file)"/>.

To get the individual file counts I did something like
this: <xsl:value-of
select="count(file[(_at_)type='txt'])"/>  but it errored on
me.  

Any ideas?

Thanks,
C


        
                
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>