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

Working around immutable variables

Subject: Working around immutable variables
From: "Jacopille, David djacopille@xxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 2 Mar 2018 21:04:48 -0000
 Working around immutable variables
Hello,

We have a for-each loop that constructs a table.  The first column is a region
that would normally look like the following b we would like to show the
first region name only to avoid repetition.

US
US
US
US
Europe
Europe
Europe
Asia
Asia

My non-xsl mind wants to use a mutable variable:

  1.  initialize a variable $current_region to bb
  2.  loop through each row
  3.  If current rowbs region column COLUMN[@name=bregionb] does not
equal $current_region then:
     *   select the region so it shows in the table
     *   reassign $current_region to the string value of the current rowbs
region column

Perhaps comparing the current category to the preceding-sibling?

Perhaps a loop on select=bdistinct_valuesb& to find region names, enclosing
another loop that goes through each distinct regionbs rows?  If position()=1
worked in that context perhaps this would work?

Webre aware of the saxon namespace that allows for the mutable variable
cheat, but would like to avoid this.

I would greatly appreciate your recommendations.

Thank you,
David Jacopille
Boston


MFS Email system made the following annotation
-----------------------------------------------------------------------------
----------------------------------------------------------
This email communication and any attachments may contain proprietary,
confidential, or privileged information. If you are not the intended
recipient, you are hereby notified that you have received this email in error
and that any review, disclosure, dissemination, distribution or copying of it
or its contents is prohibited. The sender does not waive confidentiality or
any privilege by mistransmission. If you have received this email in error,
please notify the sender immediately, delete this email, and destroy all
copies and any attachments.

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.