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

Re: Value of variable not appearing in the <xsl:other

Subject: Re: Value of variable not appearing in the <xsl:otherwise> of xml:choose
From: "Terry Ofner tdofner@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 21 Sep 2021 19:27:21 -0000
Re:  Value of variable not appearing in the  <xsl:other
Geert,

Yep. That solves the problem. Thanks. Should have seen that before.

Terry

> On Sep 21, 2021, at 3:21 PM, Geert Bormans geert@xxxxxxxxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> I think you need to give the variable a value outside the for-each-group
> @nextExposID
> is not available in all groups
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     xmlns:xs="http://www.w3.org/2001/XMLSchema"
>     xmlns:math="http://www.w3.org/2005/xpath-functions/math"
>     exclude-result-prefixes="xs math"
>     version="3.0">
>
>     <xsl:output indent="1"></xsl:output>
>
>     <xsl:template match="div">
>         <xsl:variable name="exploreExposID">
>             <xsl:value-of select="@id"/>
>         </xsl:variable>
>         <xsl:variable name="part3ID">
>             <xsl:value-of
select="div[@class='analyze_visual']/@nextExposID"></xsl:value-of>
>         </xsl:variable>
>         <div>
>             <xsl:copy-of select="@*"/>
>             <xsl:for-each-group select="*"
group-ending-with="div[@class='analyze_visual']">
>                 <xsl:choose>
>                     <xsl:when
test="current-group()[self::div[@class='analyze_visual']]">
>                         <part num="1" globalNumn="{$exploreExposID}">
>                             <xsl:copy-of
select="current-group()[not(self::div[@class='analyze_visual'])][not(self::h9
)]"/>
>                         </part>
>                         <part num="2" globalNum="{$part3ID}">
>                             <xsl:copy-of
select="current-group()[self::div[@class='analyze_visual']]"></xsl:copy-of>
>                         </part>
>                     </xsl:when>
>                     <xsl:otherwise>
>                         <part num="3">
>                             <xsl:attribute name="globalNum">
>                                 <xsl:value-of select="$part3ID"/>
>                             </xsl:attribute>
>                             <xsl:copy-of select="current-group()"/>
>                         </part>
>                     </xsl:otherwise>
>                 </xsl:choose>
>             </xsl:for-each-group>
>         </div>
>     </xsl:template>
>
> </xsl:stylesheet>
>
>
>
> Met vriendelijke groeten,
> Best regards,
>
> Geert Bormans
>
>
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/554170> (by
email <applewebdata://6C658FBF-F6F6-4597-A371-E57E34769EA3>)
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/723745> (by
email <>)

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.