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

RE: Displaying column headers only if variable changes

Subject: RE: Displaying column headers only if variable changes
From: "Brian Burridge" <brian_burridge@xxxxxxxxxxxxx>
Date: Mon, 11 Feb 2002 14:23:52 -0500
xslt variable if else
I'm using MagicDraw and they use XSL to generate their reports. I'm customizing it for our company.

I believe it is custom XML.

Brian

-----Original Message-----
From: Dennis Daniels [mailto:ddaniels@xxxxxxxx]
Sent: Monday, February 11, 2002 2:08 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Displaying column headers only if variable changes


Hello Brian
You're building UML diagrams, yeh? My I ask with what tool? What format is
your diagram coordinate data being saved in? SVG? PGML? custom xml? I ask
because I'm currently working on an xslt for pgml to svg (btw if anyone else
has done similar I'd love to hear from you!) for www.argouml.org
thanks
Dennis
----- Original Message -----
From: "Brian Burridge" <brian_burridge@xxxxxxxxxxxxx>
To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, February 11, 2002 7:05 PM
Subject:  Displaying column headers only if variable changes


>
> I have an xml list of diagrams. Each diagram has a type. I am sorting on
that type with,
>
> <xsl:sort data-type="text" order="descending" case-order="upper-first"
select="type"/>
> <xsl:sort data-type="text" order="ascending" case-order="upper-first"
select="Foundation.Core.ModelElement.name"/>
>
> This works fine. What I need to do now, however, is every time the type
changes, print the type name. This would result in something like this:
>
> Activity
> diagram 1
> diagram 2
>
> Use Case
> diagram 1
> diagram 2
>
> Sequence
> diagram 1
> diagram 2
> diagram 3
>
> I set up a global variable called lastDiagramType, using this code:
> <xsl:variable name="lastDiagramType">LAST</xsl:variable>
>
> And I'm checking it like this as I loop through in my for-each:
> <xsl:if test="type != $lastDiagramType">
> <b><xsl:value-of select="type"/></b><br/>
> <xsl:variable name="lastDiagramType"><xsl:value-of
select="type"/></xsl:variable>
> <b><xsl:value-of select="lastDiagramType"/></b><br/>
> </xsl:if>
>
> Problem is, it doesn't set the "lastDiagramType" variable to the new type.
As you see in the code, right now I'm printing what lastDiagramType is
changed to, for debug purposes, and it never changes. It stays "LAST" as I
default set it, but it is hitting that code.
>
> Any ideas?
>
> Brian N. Burridge
> Sr. Internet Developer Analyst
> The Internet Group @ Cox Target Media
>
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 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

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.