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

RE: problem with boolean AND expression [false AND fal

Subject: RE: problem with boolean AND expression [false AND false ->true] in xslt2.0
From: "Robby Pelssers" <robby.pelssers@xxxxxxxxx>
Date: Thu, 10 Dec 2009 12:56:13 +0100
RE:  problem with boolean AND expression [false AND fal
Thx Michael,

Using the schema aware processor would probably only make sense if I
were to apply a single xslt on an xml document referencing a schema.
However, I'm using cocoon pipelines to process 1 document where the
intermediate results no longer conform to the original schema so these
kinds of mistakes seem unavoidable.  Unless you have a good proposal for
this particular way of working?

Many thx for spotting this stupid error ;-)

Robby

-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Sent: Thursday, December 10, 2009 12:51 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  problem with boolean AND expression [false AND false
->true] in xslt2.0


Check your spelling of "entry" vs "Entry". XML is case-sensitive.

To avoid such errors, consider using schema-awareness, which will check
the
names appearing in path expressions against the names that are valid
according to the schema.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay

> -----Original Message-----
> From: Robby Pelssers [mailto:robby.pelssers@xxxxxxxxx]
> Sent: 10 December 2009 11:32
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  problem with boolean AND expression [false AND
> false ->true] in xslt2.0
>
> Hi all,
>
> I have the weirdest problem with the result of a AND
> expression of 2 booleans.  I'm using Saxon8.7 FYI.
>     <xsl:variable name="symbolAndParameterAreEqual"
> select="deep-equal($previousRow/Entry[1],
> $currentRow/Entry[1]) and deep-equal($previousRow/Entry[2],
> $currentRow/Entry[2])"
> as="xs:boolean"/>
>
>     <xsl:comment>
>     symbol matches precedingrow = <xsl:value-of
> select="deep-equal($previousRow/entry[1], $currentRow/entry[1])"/>
>     parameter matches precedingrow = <xsl:value-of
> select="deep-equal($previousRow/entry[2], $currentRow/entry[2])"/>
>     both are equal = <xsl:value-of
> select="$symbolAndParameterAreEqual"/>
>     </xsl:comment>
>
> Results in
> <!--
>     symbol matches precedingrow = false
>     parameter matches precedingrow = false
>     both are equal = true
> -->
>
> The deep-equal function always returns the good result but when
> combining the two Boolean results in an AND expression they always
> return True.
>
> Anyone who can shed any light onto this problem?
>
> Kind regards,
> Robby Pelssers
> http://robbypelssers.blogspot.com/

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.