xml:id type error with schema-aware Schematron
Posted: Fri Apr 13, 2018 9:38 am
Hi all,
in my project i need schema-aware schematron for checking consistency of some files, so i turned on the "Use Saxon EE (schema-aware) schematron for xslt2 / xslt3 language binding" option in the project preferences.
Doing so leads to error messages when validating one of my xslt scripts. This happens only in Oxygen version 20, there was no problem with Oxygen 19.1. For demonstration purposes i boilt down to this minimal script:
Validating this xsl script gives in Oxygen v20:
I don`t know what the problem is, since the function ns:gen-id returns the correct type xs:ID. Additionally, when i change the template to:
everything is fine, the error has vanished.
I thik it is a bug in the Schematron schema for xslt.
Environment: Windows 10 32bit oXygen/> XML Editor 20.0, build 2018032903
Sincerery, Frank
in my project i need schema-aware schematron for checking consistency of some files, so i turned on the "Use Saxon EE (schema-aware) schematron for xslt2 / xslt3 language binding" option in the project preferences.
Doing so leads to error messages when validating one of my xslt scripts. This happens only in Oxygen version 20, there was no problem with Oxygen 19.1. For demonstration purposes i boilt down to this minimal script:
Code: Select all
<xsl:function name="ns:gen-id" as="xs:ID">
<xsl:param name="e" as="element()"/>
<xsl:sequence select="generate-id($e)"/>
</xsl:function>
<xsl:template match="/test">
<result xml:id="{ns:gen-id(.)}">
<xsl:copy-of select="@* | * | text()"/>
</result>
</xsl:template>
Code: Select all
Scenario name: XSLT
Document type: XSLT
Engine name: ISO Schematron
Severity: error
Description: The value '{ns:gen-id(.)}' is not a valid xs:ID
Start location: 13:41
Code: Select all
<xsl:template match="/test">
<result>
<xsl:attribute name="xml:id" select="ns:gen-id(.)"/>
<xsl:copy-of select="@* | * | text()"/>
</result>
</xsl:template>
I thik it is a bug in the Schematron schema for xslt.
Environment: Windows 10 32bit oXygen/> XML Editor 20.0, build 2018032903
Sincerery, Frank