xsl-list
[Top] [All Lists]

Re: [xsl] XSLT Hello World

2014-03-25 13:15:49
Hi,

Here is my "Good Riddance, World":

<xsl:template match="/*">
   <xsl:choose>
      <xsl:when test="text() != text()">You win!</xsl:when>
      <xsl:otherwise>You lose!</xsl:otherwise>
   </xsl:choose>
</xsl:template>

This is homework for Day One of Intro to XSLT. The problem is to write
the source document that produces the desired outcome.

Cheers, Wendell


On Tue, Mar 25, 2014 at 12:10 PM, Andrew Welch 
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> wrote:

Yes but unless you have a very strange definition of "2 sequences are
different" don't use != on that day.

!= is true if _any_ element of a is not equal to any element of b so it
is only false if all items of both sequences are equal to the same value.

ah of course... took a while for the penny to drop there.. you are
right, this really does fall into the 'you never want to use it'
category.


--
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




-- 
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>