Schematron schema with castable fails to compile
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 4
- Joined: Wed Nov 28, 2012 12:11 pm
Schematron schema with castable fails to compile
Hi,
I'm trying to validate a date by using castable in a schematron file:
I can transform this sch file to an XSLT with the ISO iso_svrl_for_xslt2.xsl stylesheet, and then use the result to validate a document. So it seems the above sch file is OK.
However, trying to apply the above .sch file directly to the same example XML document in Oxygen 11.2 Professional returns a warning:
It is a bit of a hassle to not be able to use Oxygen for quick debugging of sch files.
Any thoughts how to solve this?
I'm trying to validate a date by using castable in a schematron file:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<pattern>
<rule context="//meta[@name='OVERHEIDop.einddatum']">
<assert test="@content castable as xs:date">Geen juiste datum</assert>
</rule>
</pattern>
</schema>
However, trying to apply the above .sch file directly to the same example XML document in Oxygen 11.2 Professional returns a warning:
And ultimately a fatal error.SystemID: /Users/matthijs/Dropbox/werk/nieuwe_opzet/metadata/code/genereer_schematron/test_juni_2012/castable_test.sch
Engine-naam: ISO Schematron
Ernst: warning
Omschrijving: Error in expression @content castable as xsUnexpected token <name> beyond end of expression
It is a bit of a hassle to not be able to use Oxygen for quick debugging of sch files.
Any thoughts how to solve this?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Schematron schema with castable fails to compile
Hello,
You are using "castable as" which is only available in XSLT/XPath 2.0. To make this work, you have to specify on the schema root the attribute:
queryBinding="xslt2"
Regards,
Adrian
You are using "castable as" which is only available in XSLT/XPath 2.0. To make this work, you have to specify on the schema root the attribute:
queryBinding="xslt2"
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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