xml:id type error with schema-aware Schematron
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 87
- Joined: Tue Jan 01, 2013 3:19 pm
xml:id type error with schema-aware Schematron
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
-
- Posts: 389
- Joined: Thu Jul 01, 2004 12:29 pm
Re: xml:id type error with schema-aware Schematron
Hello Frank,
When an XSL is validated against a Schematron schema it is considered to be an XML.
From the XML point of view this is not a correct ID: xml:id="{ns:gen-id(.)}". This is because the value {ns:gen-id(.)} will not be evaluated at validation. Therefore, the error reported by Saxon is correct: The value '{ns:gen-id(.)}' is not a valid xs:ID
It seems that in the latest Saxon where added some improvements and are check also the ID attributes if the schema-aware support is activated.
Your workaround to use "xsl:attribute" it is good. You can also disable the Schematron checks for XSLT documents if you don't need them. You can do this by modifying the validation scenario from the XSLT framework. For this you need to go to "Options->Preferences-> Document Type Association options page", edit the XSLT document type, and in the Validation tab uncheck the XSLT scenario as default scenario.
Best Regards,
Octavian
When an XSL is validated against a Schematron schema it is considered to be an XML.
From the XML point of view this is not a correct ID: xml:id="{ns:gen-id(.)}". This is because the value {ns:gen-id(.)} will not be evaluated at validation. Therefore, the error reported by Saxon is correct: The value '{ns:gen-id(.)}' is not a valid xs:ID
It seems that in the latest Saxon where added some improvements and are check also the ID attributes if the schema-aware support is activated.
Your workaround to use "xsl:attribute" it is good. You can also disable the Schematron checks for XSLT documents if you don't need them. You can do this by modifying the validation scenario from the XSLT framework. For this you need to go to "Options->Preferences-> Document Type Association options page", edit the XSLT document type, and in the Validation tab uncheck the XSLT scenario as default scenario.
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service