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

Re: Getting WordprocessingML p style

Subject: Re: Getting WordprocessingML p style
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 2 Feb 2007 19:19:15 GMT
Re:  Getting WordprocessingML p style
>   Mmh, just use eq if you compare an atomic value to an other one, and
> = if you test if an atomic value is equal to one of several values,
> isn't it?

It isn't just the cardinality rules that are different, the way
comparing values of different types are handled differs as well, with =
being more lenient than eq (and even more lenient in backward
compatibilty mode). Generally speaking I find the = behaviour more
natural, and easier to type (which is an important consideration:-)

compare the stylesheet below which returns
$ saxon8 -it main eq.xsl 
Error on line 6 of file:/c:/tmp/eq.xsl:
  XPTY0004: Cannot compare xs:decimal to xdt:untypedAtomic
Failed to compile stylesheet. 1 error detected.

change the eq to = and it returns
$ saxon8 -it main eq.xsl 
<?xml version="1.0" encoding="UTF-8"?>true


Daviid

<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:variable name="x">
  <x>2</x>
</xsl:variable>
  <xsl:template name="main">
    <xsl:value-of select="2.0 eq $x"/>
  </xsl:template>
</xsl:stylesheet>

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.