Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema-Awareness #297

Open
pmenso57 opened this issue Nov 16, 2019 · 5 comments
Open

Schema-Awareness #297

pmenso57 opened this issue Nov 16, 2019 · 5 comments

Comments

@pmenso57
Copy link

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.

@ndw
Copy link
Owner

ndw commented Jan 3, 2020

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

@macksol
Copy link

macksol commented Mar 2, 2020

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>

@ndw
Copy link
Owner

ndw commented Apr 13, 2020

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

@pmenso57
Copy link
Author

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

@JDziurlaj
Copy link

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

aj-stein-nist added a commit to aj-stein/notebook that referenced this issue Aug 18, 2022
aj-stein-nist pushed a commit to aj-stein/notebook that referenced this issue Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants