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

RE: XPath expression that generates false plus a messa

Subject: RE: XPath expression that generates false plus a message?
From: "Costello, Roger L." <costello@xxxxxxxxx>
Date: Mon, 25 Apr 2011 06:00:13 -0400
RE:  XPath expression that generates false plus a messa
Hi David,

> You said it didn't work, but you didn't say what you did or what effect
> you saw.

I used the XPath expression within the new XML Schema 1.1 <assert> element:

    <xs:element name="meeting">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="start" type="xs:time" />
                <xs:element name="end" type="xs:time" />
            </xs:sequence>
            <xs:assert test="if (xs:time(start) gt xs:time(end)) then
                                                     true()
                                               else
                                                      trace(false(), 'Hey, the
meeting ends before it begins!')" />
        </xs:complexType>
    </xs:element>

Here is a <meeting> with bad data:

<meeting>
     <start>10:00:00</start>
     <end>09:00:00</end>
</meeting>

I want an error to be thrown on this bad data. That will happen only if the
"else" part returns a false. Since no error was thrown, I infer that the
trace() function did not return false().

What are your thoughts on this?

/Roger

-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: Monday, April 25, 2011 5:46 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Cc: Costello, Roger L.
Subject: Re:  XPath expression that generates false plus a message?

On 25/04/2011 10:38, Costello, Roger L. wrote:
> If there any way to return a false, but have a string come along with it?

The code you posted.

You said it didn't work, but you didn't say what you did or what effect
you saw.

David

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.