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

RE: Can XSL recognize IE5 versus Netscape?

Subject: RE: Can XSL recognize IE5 versus Netscape?
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Fri, 12 May 2000 00:38:22 -0400 (EST)
xsl vendor
At 10 May 2000 15:01 -0400, Medina, Edward wrote:
 > Hey Tony, why did you do this?
 > 
 > <xsl:otherwise>
 >    <msxsl:choose>
 >      <msxsl:when test=".">
 >        </msxsl:when>
 >         <msxsl:otherwise>
 >           <p>Vendor: <xsl:value-of select="system-property('xsl:vendor')"/>
 >           <br/>Vendor URL:
 >            <xsl:value-of select="system-property('xsl:vendor-url')"/></p>
 >         </msxsl:otherwise>
 >    </msxsl:choose>
 > </xsl:otherwise>

When running on IE5, the XSL processor pays attention to the elements
with the "msxsl" prefix.  When it does so, it will never get to the
<msxsl:otherwise> element, so the <p> literal result element and the
second versions of the "Vendor: " and "Vendor URL:" literal text will
not be added to the result tree.

 > Why not just
 > <xsl:otherwise>
 >   <msxsl:if test=".">
 >   </msxsl:if>
 >     <p>Vendor: <xsl:value-of select="system-property('xsl:vendor')"/>
 >       <br/>Vendor URL:
 >     <xsl:value-of select="system-property('xsl:vendor-url')"/></p>
 > </xsl:otherwise>

This will get you an unwanted copy of the "Vendor: " and "Vendor URL:"
literal text.

 > Wouldn't that be the the same, every time your test is true it
 > will do nothing and then continue?

The real reason was that I couldn't come up with a "test" attribute
value that was always false according to the IE5 XSL processor.  I was
in a hurry, so after I tried a few things that didn't work (and got
errors about requiring a DOM node), I fell back to testing "." and
using <msxsl:otherwise> inside <msxsl:choose> for the false case.

I did mention when I posted the stylesheet to the list that I was
looking for suggestions for improvement.  Now you know why.

Regards,


Tony Graham
======================================================================
Tony Graham                            mailto:tgraham@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9632
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================



 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.