xsl-list
[Top] [All Lists]

Re: [xsl] Why does this XPath expression work fine when run in Oxygen but fails when used in an XSD 1.1 assert element?

2019-12-02 11:48:00
On Mon, Dec 02, 2019 at 05:26:37PM -0000, Costello, Roger L.
costello(_at_)mitre(_dot_)org scripsit:
Why does the XPath query work fine when run in Oxygen but fails when
used in an XSD 1.1 assert element?

When you assert:

*[local-name(.) eq 'style']/following-sibling::comment()[1]/starts-with(., '[if 
gte mso 9]><xml>')

you're checking outside the element node.  Assertions only evaluate against the 
element being defined; you don't get any of the rest of the document.  XPath 
has the whole document.

https://www.w3.org/TR/xmlschema11-1/#Assertion_details says

To check an assertion, an instance of the XPath 2.0 data model ([XDM]) is 
constructed, in which the element information item being ·assessed· is the 
(parentless) root node, and elements and attributes are assigned types and 
values according to XPath 2.0 data model construction rules, with some 
exceptions.


-- Graydon
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>