Re: [Hypercontent-users] XLS Question
Brought to you by:
alexvigdor
From: Alex V. <al...@bi...> - 2006-12-13 13:15:32
|
Hi Carl, You can combine those tests using the "and" operator <xsl:variable name="specific-books" select="/cms:wrapper/cms:source/ metadata/book[subject[contains(.,$subject)] and type[contains (.,'Articles in journals')]]"/> You can then base the count and conditional statements off of that variable. Cheers, Alex On Dec 13, 2006, at 5:37 AM, Carl P Barrow wrote: > Hi all, > > This is an XSL question rather than directly relating to > HyperContent, but I've been trying to get it going for some time > and thought I check if anyone can help me out. > > I have an XMl file: > > <metadata> > <book> > <title></title> > <alternative></alternative> > <creator></creator> > <subject></subject> > <description></description> > <publisher></publisher> > <date></date> > <type></type> > <format></format> > <identifier></identifier> > <relation></relation> > <coverage></coverage> > <rights></rights> > </book> > </metadata> > > I am counting how many books have a specific subject: > > <xsl:value-of select="count(/cms:wrapper/cms:source/metadata/book > [subject[contains(.,$subject)]])"/> > > Then I split that down to display all books in a subject that have > a specific type: > > <xsl:for-each select="/cms:wrapper/cms:source/metadata/book[subject > [contains(.,$subject)]]"> > <xsl:if test="type[contains(.,'Articles in journals')]"> > <xsl:call-template name="listproc"/> > </xsl:if> > </xsl:for-each> > > I want to do two other things which I'm having problems with: > 1 - Count the number of books that have a specific subject and a > specific type. > 2 - If there are books with a specific subject and a specific type > display something on the page. > > Any help appreciated > > thanks > Carl > > ************************************* > > Carl Barrow > Systems Integrator > e-Services > The University of Hull > Cottingham Road > Hull > HU6 7RX > Ext. 6838 > > ************************************* > > > > ********************************************************************** > ******************* > To view the terms under which this email is distributed, please go > to http://www.hull.ac.uk/legal/email_disclaimer.html > ********************************************************************** > *******************--------------------------------------------------- > ---------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV________________________________ > _______________ > Hypercontent-users mailing list > Hyp...@li... > https://lists.sourceforge.net/lists/listinfo/hypercontent-users |