[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Is there any multiple if exression (not xsl:if) available in xpath/xslt2 ?


Subject: Re: [xsl] Is there any multiple if exression (not xsl:if) available in xpath/xslt2 ?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 20 Jul 2006 11:05:42 +0100

in answer to the question in the subject line
<xsl:choose>
  <xsl:when>...
  <xsl:when>...
  <xsl:otherwise>...

would seem to be what you are looking for.


> and the combination can be anything as those 3 elemts are optional. I
> can have many <xsl:if>s to find and get what i want. 

It's not clear why you need any if test at all, what's wrong with

<xsl:apply-templates select="section,ref,ack,app"/>

which will just convert those sections and the optional elements igf
they are there and not if they are not?

  Also, i need to count Total num of pages. Is there any expr like 
  Total pages = <xsl:value of select"count(//section) + if(ref) add 1 +
  if (ack) add 1 + if(app) add 1"/> 

select="count(//section,ref,ack,app)"

or in xslt1

select="count(//section|ref|ack|app)"

David


Current Thread