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

RE: xsl:number problem

Subject: RE: xsl:number problem
From: "Yan, Charlene" <Charlene.Yan@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 20 Jun 2003 14:42:07 -0400
number problem
Thank you! Thank you! and thank you!!!!  I added <xsl:if test="../publisher='Wave' or ../publisher='NETg' "> when I got your email.  I have the output of 1,2, empty cell, 4, 5 withou the condition added in the count pattern.  But yours gives exactly what my output should look like.

Best regards,


-----Original Message-----
From: Markus Abt [mailto:abt@xxxxxxxx]
Sent: Friday, June 20, 2003 2:25 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: AW:  xsl:number problem

Hello Charlene,

what you wan't is:

<xsl:number level="any" count="productId[../publisher='Wave' or ../publisher='NETg']"/>
<xsl:number level="any" count="productId[following-sibling::publisher='Wave' or following-sibling::publisher='NETg']"/>

That's because publisher is not a child element node of productId but it is a sibling.
This should give you four cells in your worksheet, but...

... you will get 1, 3, 4, and 5.
What you really wan't is (I'm guessing): 1, 2, 4, and 5.
In this case you must prevent productId 3 from "overwriting" productId 2.
(I do not know if it really overwrites, but you are generating two
contents for one cell.)

  <xsl:template match="productId">
    <xsl:if test="../publisher='Wave' or ../publisher='NETg' ">
     <gmr:Cell Col="0" ValueType="60">
      <xsl:variable name="rownumber"><xsl:number level="any" count="productId[../publisher='Wave' or ../publisher='NETg']"/></xsl:variable>
      <xsl:attribute name="Row">
         <xsl:value-of select="$rownumber"/>

I guess you showed us only part of your stylesheet. You will need a template
for "publisher" to either generate that in a second column, or to suppress it.

Hope this helps,
Markus Abt

Comet Computer GmbH
Rückertstraße 5
80336 München
Tel 089 / 5445 6045
Fax 089 / 5445 6046

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.