Re: <xsl:define-constant> and many-to-many element relationships

Subject: Re: <xsl:define-constant> and many-to-many element relationships
From: Guy_Murphy@xxxxxxxxxx
Date: Thu, 10 Dec 1998 11:53:56 +0000
Hi.

I didn't think much on your post when originaly placed, but having now run
into the exact same problem
I think yours to be one of the most erudite posts for quite a while :)

The need for <xsl:define-constant>... is pretty huge, especialy in the
production of renderable output for things
like colours etc., as it's the only way to approximate the casscading
aspect of CSS without resort as you suggest
to evaluated constants.

Cheers
     Guy.





xsl-list@xxxxxxxxxxxxxxxx on 12/06/98 12:58:29 AM

To:   xsl-list@xxxxxxxxxxxxxxxx
cc:    (bcc: Guy Murphy/UK/MAID)
Subject:  <xsl:define-constant> and many-to-many element relationships




I am wondering if the as-of-now  IE5b2 MIA <xsl:define-constant> will
resurface at some point.  I don't know if the syntax from the draft and
other current implementations would work with the (assumed) state of the
next draft reflected in the IE5b2 implementation, but does something
like this seem possible?
<TABLE>
<xsl:for-each select="//INFOUNIT">
   <xsl:define-constant name="IUID"><xsl:value-of
select="@ID"/></xsl:define-constant>
   <xsl:for-each select="//PRODUCT">
      <TR>
        <TD><xsl:value-of select="constant(IUID)"/></TD>
        <TD><xsl:value-of select="@MODELID"/></TD>
        <TD><xsl:value-of select="@MODELYR"/></TD>
        <TD><xsl:value-of select="MODELDESC"/></TD>
      </TR>
   </xsl:for-each>
</xsl:for-each>
</TABLE>
As it stands now, I use <xsl:eval>, but I believe there's a special
place in Hell for people who create XSL stylesheets like this, and I'd
prefer not to go there.  Also, there may be another, better way to do
this that I just haven't figured out:
<TABLE>
<xsl:for-each select="//INFOUNIT">
   <xsl:eval>/*define-constant*/ var IUID=getAttribute("ID");</xsl:eval>
   <xsl:for-each select="//PRODUCT">
   <TR>
        <TD><xsl:eval>/*constant*/IUID</xsl:eval></TD>
        <TD><xsl:value-of select="@MODELID"/></TD>
        <TD><xsl:value-of select="@MODELYR"/></TD>
        <TD><xsl:value-of select="MODELDESC"/></TD>
   </TR>
   </xsl:for-each>
</xsl:for-each>
</TABLE>
__________________________________
SPX - Valley Forge T.I.S.
25691 Atlantic Ocean Drive Suite B-7
Lake Forest, CA 92630
USA    www.vftis.com
__________________________________
Tel:    (949) 460 0094
Fax:    (949) 460 0095
e-Mail: gpaiz@xxxxxxxxx
__________________________________

 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