[oXygen-user] Schematron validation of documents using XInclude succeeds when it should fail.
Octavian Nadolu
octavian_nadolu at sync.ro
Fri May 12 01:19:32 CDT 2023
Hello Danny,
The Schematron specification does not define how the XInclude is
processed. In Oxygen we expand the XInclude in order to help the user to
process the content more easily.
If you don't want to expand the XInclude, you can go to uncheck the
"Enable XInclude processing" option from XML Parser options page. For
this, open the Preferences dialog box (Options > Preferences) and go to
XML > XML Parser.
https://www.oxygenxml.com/doc/versions/25.1/ug-editor/topics/preferences-xml-parser.html
Best Regards,
Octavian
On 5/11/2023 10:34 PM, Danny MacMillan wrote:
> Thanks.
>
> With the documents attribute, it works with SchXslt and doesn't work
> in Oxygen. Without the documents attribute, it works in Oxygen and
> doesn't work in SchXslt. So it seems like there's no way to write a
> Schematron schema that uses XInclude that will work everywhere. It
> seems like it must be a bug in either Oxygen or SchXslt. I thought it
> was an Oxygen bug because the SchXslt behaviour corresponds to the
> Schematron book. But I'm just learning Schematron so I can't be sure.
>
> --
> Danny MacMillan
>
> Sent with Proton Mail <https://proton.me/> secure email.
>
> ------- Original Message -------
> On Thursday, May 11th, 2023 at 00:19, Oxygen XML Editor Support
> (Octavian Nadolu) <support at oxygenxml.com> wrote:
>
>> Hello Danny,
>>
>> The XInclude is automatically expanded when you validate with
>> Schematron in Oxygen. Therefore, you do not need to use the
>> "documents" attribute. The sample subdocuments-1.sch file can be
>> changed something like this:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <schema xmlns="http://purl.oclc.org/dsdl/schematron"
>> queryBinding="xslt3">
>> <pattern>
>> <rule context="p">
>> <assert test="@class ne 'brightred'">
>> The class <value-of select="@class"/> is forbidden
>> (<value-of select="base-uri(.)"/>)!
>> </assert>
>> </rule>
>> </pattern>
>> </schema>
>>
>> Best Regards,
>> Octavian
>>
>> On 5/10/2023 12:21 AM, Danny MacMillan wrote:
>>> Hello,
>>>
>>> I'm going through the Schematron book by Erik Siegel and one of his
>>> examples improperly passes validation in Oxygen XML while it
>>> correctly fails validation using SchXslt.
>>>
>>> The code for the book is here:
>>> https://github.com/xatapult/schematron-book-code
>>> <https://github.com/xatapult/schematron-book-code.git>
>>>
>>> I open both examples/additional-features/subdocuments-1.sch and
>>> data/subdocuments-master.xml from that project in Oxygen and select
>>> the tab with the XML file. Then I click the dropdown on the
>>> Validation button on the toolbar and click Validate with... and then
>>> I select the subdocuments-1.sch file using the dropdown. When I
>>> proceed Oxygen says it passes. This is the same approach I have used
>>> for all other examples in the book. But I created an explicit
>>> validation scenario for this also and it behaves the same way.
>>>
>>> Note that if you want to test this you should clone the repository
>>> because the subdocuments-master.xml file incorporates other files in
>>> the repository by reference using XInclude and this is indeed what
>>> seems not to be working in Oxygen.
>>>
>>> By contrast if I run the same validation using the schxslt-cli.jar I
>>> get the following, expected result.
>>>
>>> [invalid]
>>> /home/user/task/schematron-book-code/data/subdocuments-master.xml
>>> [invalid]
>>> /home/user/task/schematron-book-code/data/subdocuments-master.xml
>>> failed-assert /Q{}document[1]/Q{}p[1]
>>> The class brightred is forbidden
>>> (file:/home/user/task/schematron-book-code/data/subdocuments-2.xml)!
>>>
>>> I am using the latest Oxygen: <oXygen/> XML Editor 25.1, build
>>> 2023042509
>>>
>>> Thanks,
>>>
>>> --
>>> Danny MacMillan
>>>
>>> Sent with Proton Mail <https://proton.me/> secure email.
>>>
>>> _______________________________________________
>>> oXygen-user mailing list
>>> oXygen-user at oxygenxml.com
>>> https://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>
>>
>> --
>> Octavian Nadolu
>> <oXygen/> XML Editor
>> http://www.oxygenxml.com
>
>
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> https://www.oxygenxml.com/mailman/listinfo/oxygen-user
--
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20230512/6e456cbf/attachment.htm>
More information about the oXygen-user
mailing list