Subject: Re: [xsl] XPath expression that generates false plus a message? From: Michael Kay <mike@xxxxxxxxxxxx> Date: Mon, 25 Apr 2011 21:51:49 +0100 |
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>
Michael Kay Saxonica
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XPath expression that gen, David Carlisle | Thread | [xsl] RE: Variations in XML to CSV, mlcook |
Re: [xsl] RE: Variations in XML to , G. Ken Holman | Date | [xsl] Setting default namespace in , Steve Fogel |
Month |