ISO Schematron with XPath 2.0
Are you missing a feature? Request its implementation here.
-
- Posts: 4
- Joined: Sun May 27, 2007 10:00 am
ISO Schematron with XPath 2.0
Hi,
I don't know if this is possible in Oxygen 8.2, but I'd like to have XPath 2.0 as the query language in ISO Schematron schemas. I tried the option "XML / XML Parser / Schematron XPath Version", but it seems to work only with Schematron 1.5 schemas, right?
Another issue: when editing an XML document that uses an XML Schema with embedded schematron, the "validation as I type" engine is not reporting assertions from schematron rules. Is it a missconfiguration? Or, since it was working until version 8.1, is it a recent design decision?
BTW, these two issues made me switch back to Oxygen 8.1 and schematron 1.5.
Thanks in advance,
Marcelo Moreno
I don't know if this is possible in Oxygen 8.2, but I'd like to have XPath 2.0 as the query language in ISO Schematron schemas. I tried the option "XML / XML Parser / Schematron XPath Version", but it seems to work only with Schematron 1.5 schemas, right?
Another issue: when editing an XML document that uses an XML Schema with embedded schematron, the "validation as I type" engine is not reporting assertions from schematron rules. Is it a missconfiguration? Or, since it was working until version 8.1, is it a recent design decision?
BTW, these two issues made me switch back to Oxygen 8.1 and schematron 1.5.
Thanks in advance,
Marcelo Moreno
-
- Site Admin
- Posts: 2097
- Joined: Thu Jan 09, 2003 2:58 pm
Hi,
In ISO Schematron you have a queryBinding attribute in sch:schema element that can be set to xslt2 to specify that you want to use XSLT 2.0 language binding. That will enable usage of XPath 2.0 inside your ISO Schematron schema. I have to see what happens if the schema is embedded - in that case there is no sch:schema so no queryBinding attribute.
I will look into the validation issue you mention and let you know.
Best Regards,
George
In ISO Schematron you have a queryBinding attribute in sch:schema element that can be set to xslt2 to specify that you want to use XSLT 2.0 language binding. That will enable usage of XPath 2.0 inside your ISO Schematron schema. I have to see what happens if the schema is embedded - in that case there is no sch:schema so no queryBinding attribute.
I will look into the validation issue you mention and let you know.
Best Regards,
George
George Cristian Bina
-
- Posts: 4
- Joined: Sun May 27, 2007 10:00 am
Thanks, George!
Yes, some weeks ago I tested this queryBinding attribute in a standalone schematron schema. It worked correctly. But now I need to make it work with embedded rules, as you correctly deduced. I hope you find a way...
Anyway, it would be nice to have that "XPath Version" option under "XML / XML Parser / ISO Schematron" too.
About the validation thing, I'd like to be more specific: the embedded rules are written in schematron 1.5. I didn't test with ISO schematron.
Regards,
Moreno
Yes, some weeks ago I tested this queryBinding attribute in a standalone schematron schema. It worked correctly. But now I need to make it work with embedded rules, as you correctly deduced. I hope you find a way...
Anyway, it would be nice to have that "XPath Version" option under "XML / XML Parser / ISO Schematron" too.
About the validation thing, I'd like to be more specific: the embedded rules are written in schematron 1.5. I didn't test with ISO schematron.
Regards,
Moreno
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
Regards,
Sorin
I tested validation as you type against an XML Schema with embedded Schematron 1.5 rules and another XML Schema with embedded ISO Schematron rules and the embedded rules were applied correctly in both cases. Make sure you include the XML Schema file both in the xsi:schemaLocation attribute and in the oxygen processing instruction for Schematron schemas, for example:moreno wrote:About the validation thing, I'd like to be more specific: the embedded rules are written in schematron 1.5. I didn't test with ISO schematron.
Code: Select all
<?oxygen SCHSchema="Tournament.xsd"?>
We will consider allowing XPath 2.0 queries also in ISO Schematron schemas.moreno wrote:Anyway, it would be nice to have that "XPath Version" option under "XML / XML Parser / ISO Schematron" too.
Regards,
Sorin
-
- Site Admin
- Posts: 2097
- Joined: Thu Jan 09, 2003 2:58 pm
Hi,
We decided to add a new option to allow controlling the queryBinding for embedded ISO Schematron rules. It will default to xslt2 and the other possible value will be xslt1.
As Sorin replied the validation of an XML document against a schema and its embedded Schematron rules should work - in addition note that you can make the association externally, in the Default Schema Association option page there you can specify XML Schema with embedded Schematron as schema type.
Best Regards,
George
We decided to add a new option to allow controlling the queryBinding for embedded ISO Schematron rules. It will default to xslt2 and the other possible value will be xslt1.
As Sorin replied the validation of an XML document against a schema and its embedded Schematron rules should work - in addition note that you can make the association externally, in the Default Schema Association option page there you can specify XML Schema with embedded Schematron as schema type.
Best Regards,
George
George Cristian Bina
-
- Posts: 4
- Joined: Sun May 27, 2007 10:00 am
Hi,
Thanks, George. This is good news. Is it available right now?
When it will be?
Sorin, my documents were ok!
I think the problem occurs after choosing XPath 2.0 in "Schematron XPath Version" option. When I switch back to XPath 1.0, continuous validation works again.
So, try to reproduce it in the following manner: Start with a valid document; then select XPath 2.0 as schematron query language; then press "reset cache and validate"; and finally modify your document to break a schematron rule. What happens?
I used the documents below in my test:
xstest.xsd
test.xml
Regards,
Moreno
Thanks, George. This is good news. Is it available right now?

Sorin, my documents were ok!
I think the problem occurs after choosing XPath 2.0 in "Schematron XPath Version" option. When I switch back to XPath 1.0, continuous validation works again.
So, try to reproduce it in the following manner: Start with a valid document; then select XPath 2.0 as schematron query language; then press "reset cache and validate"; and finally modify your document to break a schematron rule. What happens?
I used the documents below in my test:
xstest.xsd
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sch="http://www.ascc.net/xml/schematron">
<xs:element name="everything" type="xs:integer"/>
<xs:annotation>
<xs:appinfo>
<sch:pattern name="everything must be greater than 0">
<sch:rule context="//*">
<sch:assert test=". > 0">
everything must be greater than 0!
</sch:assert>
</sch:rule>
</sch:pattern>
</xs:appinfo>
</xs:annotation>
</xs:schema>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen SCHSchema="xstest.xsd"?>
<everything xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="xstest.xsd">
5
</everything>
Moreno
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello Moreno,
Thank you for the example. I see that there is a problem with applying the embedded Schematron rules in the continuous validation if the Schematron XPath version is set to 2.0 in Preferences. We will fix that.
Thank you,
Sorin
Thank you for the example. I see that there is a problem with applying the embedded Schematron rules in the continuous validation if the Schematron XPath version is set to 2.0 in Preferences. We will fix that.
Thank you,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Yes, it is the same problem of ISO Schematron with XPath 2.0 queries. We will fix it.
Regards,
Sorin
Regards,
Sorin
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