[XML-DEV Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: XML Schema 1.1 xpath 2.0 regex question
- From: Michael Kay <mike@saxonica.com>
- To: Mukul Gandhi <mukulg@softwarebytes.org>
- Date: Wed, 15 Dec 2021 15:55:03 +0000
Validation should succeed.
With the "m" flag, it's valid, because there is a line that matches ^hello$ (and as it happens, there is also a line that matches ^world$, but that match is not needed). One match is sufficient.
Michael Kay Saxonica
Hi all, I've following XML instance document,
<?xml version="1.0"?> <X> <a> hello world </a> </X>
And the following XML Schema 1.1 document,
<?xml version="1.0"?> <xs:schema xmlns:xs=" http://www.w3.org/2001/XMLSchema"> <xs:element name="X"> <xs:complexType> <xs:sequence> <xs:element name="a" type="xs:string"/> </xs:sequence> <xs:assert test="matches(a, '^(hello|world)$', 'm')"/> </xs:complexType> </xs:element> </xs:schema>
When I validate the, XML instance document that's provided with the provided XSD 1.1 document, I get a valid outcome. Shouldn't the XSD validity outcome be invalid? It think so, because the string content of element "a" after 'world' (within XML instance document) is not either hello or world (as specified by regex within the XSD document).
Any thoughts would be helpful.
|
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|
Stylus Studio has published XML-DEV in RSS and ATOM formats,
enabling users to easily subcribe to the list from their preferred news reader application.
|
Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website.
they were not included by the author in the initial post. To view the content without the Sponsor Links please
click here.
|
|