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

RE: Problem transforming Excel XML Workbook (or how to

Subject: RE: Problem transforming Excel XML Workbook (or how to implement one-more-counter-yet in XSLT)
From: drkm <darkman_spam@xxxxxxxx>
Date: Sun, 6 Nov 2005 14:44:56 +0100 (CET)
excel current cell
Michael Kay wrote:

> <xsl:function name="excel:get-cell" as="element(Cell)?">
>   <xsl:param name="row" as="element(Row)"/>
>   <xsl:param name="cellNr" as="xs:integer"/>
>   <xsl:sequence select="excel:get-sibling-cell(Cell[1],
> (Cell[1]/@ss:Index,
> 1)[1], cellNr)"/> 
> </xsl:function>

> <xsl:function name="excel:get-sibling-cell" as="element(Cell)?">
>   <xsl:param name="current-cell" as="element(Cell)?"/>
>   <xsl:param name="current-index" as="xs:integer"/>
>   <xsl:param name="required-index" as="xs:integer"/>
>   <xsl:sequence select="
>      if (exists($current-cell)) then
>         if ($current-index eq $required-index) then
>            $current-cell
>         else
>           
excel:get-sibling-cell($current-cell/following-sibling::Cell,
>                     ($current-cell/following-sibling::Cell/@ss:index,
> $current-index + 1),

  $current-index + 1)[1],

isn't it?

>                      $required-index)
>     else ()"/>
> </xsl:function>

  And IMHO, you can change the test:

    if (exists($current-cell)) then

with something like:

    if (exists($current-cell) and
          $current-index ge $required-index) then

for stopping the recursion when the element with the
required index is not explicitely present in the document.

--drkm




















	

	
		
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Tilichargez cette version sur http://fr.messenger.yahoo.com

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.