Subject: Re: [xsl] Why does this XPath expression work fine when run in Oxygen but fails when used in an XSD 1.1 assert element? From: "G. Ken Holman g.ken.holman@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 2 Dec 2019 17:50:25 -0000 |
Hi Folks,
Below is a sample XHTML document. Immediately following the <style> element is a comment. I want to ensure that the value in the comment starts with this string:
[if gte mso 9]><xml>
Using Oxygen, I ran the following XPath query (the <head> element is the context node):
*[local-name() eq 'style']/following-sibling::comment()[1]/starts-with(., '[if gte mso 9]><xml>')
The result of running the query is:
true()
Perfect!
Next, I put the query into an XML Schema 1.1 assert element:
<xs:assert test="*[local-name(.) eq 'style']/following-sibling::comment()[1]/starts-with(., '[if gte mso 9]><xml>')" />
When I validated the XHTML document against the XML Schema, I got this error:
Assertion evaluation ('*[local-name(.) eq 'style']/following-sibling::comment()[1]/starts-with(., '[if gte mso 9]><xml>')') for element 'head' on schema type 'headType' did not succeed.
Why does the XPath query work fine when run in Oxygen but fails when used in an XSD 1.1 assert element? /Roger
Here's the XHTML document:
-- Contact info, blog, articles, etc. http://www.CraneSoftwrights.com/s/ | Check our site for free XML, XSLT, XSL-FO and UBL developer resources | Streaming hands-on XSLT/XPath 2 training class @ US$45 (5 hours free) | Essays (UBL, XML, etc.) http://www.linkedin.com/today/author/gkholman |
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Why does this XPath expre, Graydon graydon@xxxx | Thread | Re: [xsl] Why does this XPath expre, Michael Kay mike@xxx |
Re: [xsl] Why does this XPath expre, Graydon graydon@xxxx | Date | Re: [xsl] Why does this XPath expre, Costello, Roger L. c |
Month |