Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Getting WordprocessingML p style

From: David Carlisle <davidc@--------->
To:
Date: 2/2/2007 7:20:00 PM
>   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>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent