xmlcalabash1 icon indicating copy to clipboard operation
xmlcalabash1 copied to clipboard

Schema-Awareness

Open pmenso57 opened this issue 5 years ago • 5 comments

I just updated to current versions of Saxon-EE (from 9.6.0 to 9.9.1.5) and XML Calabash (from 1.1.19-96 to 1.1.29-99), and I am running into the following error:

XD0023: The supplied node has been schema-validated, but the XPath expression was compiled without schema-awareness

This appears to be occurring with a validate-with-schematron step where the input comes from a validate-with-xml-schema step.

pmenso57 avatar Nov 16 '19 22:11 pmenso57

Thanks. Apologies for the delay. I will try to look into this this weekend.

ndw avatar Jan 03 '20 00:01 ndw

Hi Norm I am also getting that error running Calabash from Oxygen 21.0 It happens for me when the file being validated has NO error

<p:try name="final"> <p:group> <p:validate-with-xml-schema name="validate"> <p:input port="source"> <p:pipe step="originalDocument" port="result"/> </p:input> <p:input port="schema"> <p:pipe port="result" step="xsdschema"/> </p:input> <p:with-option name="assert-valid" select="'true'"/> </p:validate-with-xml-schema> cx:message <p:with-option name="message" select="concat($vInputFilename,' is valid')"/> </cx:message> </p:group> <p:catch name="xsderror"> <p:identity> <p:input port="source"> <p:pipe step="xsderror" port="error"/> </p:input> </p:identity> cx:message <p:with-option name="message" select="concat($vInputFilename,' is invalid')"/> </cx:message> xo:addLogEntry <p:with-option name="logFolder" select="$logFolder"/> <p:with-option name="inputFileUri" select="$inputFileUri"/> <p:with-option name="startDateTime" select="$vStartDateTime"/> </xo:addLogEntry> </p:catch> </p:try>

ends up inside the catch, produces my message saying the files is invalid when it is not and an error output of <c:errors xmlns:c="http://www.w3.org/ns/xproc-step"> <c:error xmlns:err="http://www.w3.org/ns/xproc-error" code="err:XD0023" href="file:/C:/Users/HIDDEN/validate-content.xpl" line="6" column="32">The supplied node has been schema-validated, but the XPath expression was compiled without schema-awareness</c:error> </c:errors> When I make the file invalid and re-run I get the correct error (although twice) <c:errors xmlns:c="http://www.w3.org/ns/xproc-step"> <c:error line="23" column="41">ValidationException: Value "primarys" contravenes the enumeration facet "euretained, secondary, primary" of the type of attribute Value</c:error> <c:error line="23" column="41">ValidationException: Value "primarys" contravenes the enumeration facet "euretained, secondary, primary" of the type of attribute Value</c:error> </c:errors>

macksol avatar Mar 02 '20 11:03 macksol

I can't reproduce this. If someone has a test case, preferably one that doesn't require Oxygen, that would be very helpful.

ndw avatar Apr 13 '20 07:04 ndw

demo.zip

This is a small example that causes it as soon as you uncomment the p:with-param. My invocation looks like this:

java com.xmlcalabash.drivers.Main --saxon-configuration saxon-ee.xml -isource=demo.xml demo.xpl

pmenso57 avatar Apr 19 '20 09:04 pmenso57

Was this reproducible? I can produce a test case as well, if needed.

JDziurlaj avatar Aug 01 '20 00:08 JDziurlaj