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

Boolean Short Curcuit

Subject: Boolean Short Curcuit
From: Alan <alan-xsl-list@xxxxxxxxx>
Date: Fri, 23 Sep 2005 04:50:51 -0400
curcuit
In Saxon 8.(4|5).

I'm calling this function.

<xsl:function name="page:field" as="element()">
  <xsl:param name="name" as="xs:string"/>
  <xsl:sequence select="document($form-uri)/form/field[name = $name][1]"/>
</xsl:function>

During this template match. Note that I'm performing a test to see
if the parameter exists. I expect that when it doesn't exist, the
function part of the test will not be called.

<xsl:template
    match="page:message[ancestor::page:error[@name]
        and page:field(ancestor::page:error/@name)/error]"
    mode="page:page">
<page:message><xsl:value-of
    select="page:field(ancestor::page:error/@name)/error"/></page:message>
</xsl:template>

But it appears to be getting called.

Recoverable error of :
  XPTY0004: An error occurred matching pattern
  {page:message[ancestor::page:error[@name] and
        page:field(ancestor::page:error/@name)/error]}
  : An empty sequence is not allowed as the result of function page:field()

I can provide more context if necessary. I tried if/else statements
in the call to page:field, but that still produced the error.

Thanks.

--
Alan Gutierrez - alan@xxxxxxxxx
    - http://engrm.com/blogometer/index.html
    - http://engrm.com/blogometer/rss.2.0.xml

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.