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

RE: Elminitate redundancy by using variables

Subject: RE: Elminitate redundancy by using variables
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Wed, 24 Mar 2004 07:59:24 -0700
using variables in xslt
An interesting article that doesn't necessarily answer your question
regarding XSLT 2.0 and .NET but does help fuel the rumor mill as to just
how and what Microsoft is doing with XML and functional-based
programming implementations can be found here:

http://searchwebservices.techtarget.com/originalContent/0,289142,sid26_g
ci873910,00.html

Regarding your question about .NET and XSLT 2.0 the answer is: neither
at the present time nor at any specified point in the future.  But as
this article
(http://www.cmswatch.com/Features/ProductWatch/FeaturedProduct/?feature_
id=100) suggests near the bottom (at the same point it recommends
Michael's SAXON processor for those who want to get there hands dirty
with XSLT 2.0 now) once the 2.0 working draft becomes a recommendation
Microsoft and .NET should be soon to follow.

Where Microsoft has there head directed as far as XSLT 2.0 has been a
topic of debate for quite some time but I have no doubt that just as
this article suggests MS will release there 2.0 processing engine as
soon as it become a final recommendation of the W3C.  It's just too bad
that we .NET/C# developers can't gain access to it now!  But having used
SAXON to get familiar with XSLT 2.0 and XQuery 1.0 I can assure you it
is more than capable of giving you a fantastic test drive of what the
future holds for these two technologies.

Have a great day!

<M:D/> 

-----Original Message-----
From: Kenny Akridge [mailto:kenny@xxxxxxxxxxxxxxxxx] 
Sent: Wednesday, March 24, 2004 6:26 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Elminitate redundancy by using variables

This is interesting Michael.  Does .NET currently support XSLT 2.0?  I
keep
hearing great things about SAXON, but I am currently working with C#.
I've
heard things about J# for .NET.  I'm wondering if SAXON is going to be
ported over to .NET in any shape or form.

Thanks again.

-----Original Message-----
From: Michael Kay [mailto:mhk@xxxxxxxxx] 
Sent: Wednesday, March 24, 2004 4:38 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Elminitate redundancy by using variables

<tr>
  <xsl:attribute name="style">
    <xsl:text>background-color: </xsl:text>
    <xsl:choose>
      <xsl:when test="number($count) mod 2 = 0">
         <xsl:text>#FFFFFF;</xsl:text>
      </xsl:when>
      <xsl:otherwise>
         <xsl:text>#E7EEFF;</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:attribute>
  <td class="fieldInfo">
     <xsl:value-of select="substring(LineItemName,1,45)"/>
  </td>
</tr>

Or in XSLT 2.0:

<tr style="background-color: {if (number($count) mod 2 = 0)
                              then '#FFFFFF;'
                              else '#E7EEFF;'}/>
  <td class="fieldInfo">
     <xsl:value-of select="substring(LineItemName,1,45)"/>
  </td>
</tr>

No variables needed in either case.

Michael Kay


# -----Original Message-----
# From: Kenny Akridge [mailto:kenny@xxxxxxxxxxxxxxxxx] 
# Sent: 24 March 2004 02:59
# To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
# Subject:  Elminitate redundancy by using variables
# 
# Imagine I have xsl similar to this:
# 
# <xsl:choose>
# 	<xsl:when test="number($count) mod 2 = 0">
# 		<tr style="background-color: #FFFFFF;">
# 		   <td class="fieldInfo">
# 			<xsl:value-of
# select="substring(LineItemName,1,45)"/>
# 		   </td>
# 		</tr>
# 	</xsl:when>
# 	<xsl:otherwise>
# 		<tr style="background-color: #E7EEFF;">
# 		   <td class="fieldInfo">
# 			<xsl:value-of
# select="substring(LineItemName,1,45)"/>
# 		   </td>
# 		</tr>
# 	</xsl:otherwise>
# </xsl:choose>
# 
# You can easily see that this would be a nightmare if I had 
# even just 5 <td> elements being repeated.  Is there a way to 
# save the value from the beginning of the <td> to the end, 
# including the generate value of LineItemName?
# 
# Thanks.
# 
# 
# 

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.