Page 1 of 1

XProc 3 as a copy of XProc framework but with RNC file from XProc 3 spec

Posted: Sat Feb 22, 2020 3:21 pm
by Martin Honnen
Using oXygen 22, I would like to find a way to write/edit XProc 3.0 scripts, using the schema provided at https://spec.xproc.org/master/head/xproc/xproc30.rnc.

I tried to make a copy of the exisiting XProc document type association, named it XProc 3 and in the schema section linked to a local copy of the above schema.

Additionally, I edited the association rules and put in version="3.0" for Attribute.

Should that suffice to get oXygen to provide validation and content completion based on the XProc 3 schema when I edit a document with .xpl suffix and use version="3.0" on the root element?

Unfortunately I find no change to my XProc editing, I only get XProc 1 content completion and validation.

Re: XProc 3 as a copy of XProc framework but with RNC file from XProc 3 spec

Posted: Mon Feb 24, 2020 10:28 am
by Mircea
Hello Martin,

Thank you for the feedback.
Unfortunately (https://spec.xproc.org/), there is no XProc 3.0 engine ready yet, so we do not have support for the 3.0 version.
The schema used for content completion and for validation are hardcoded for 1.0

We plan to add this feature in 22.1 version of Oxygen.

Regards,
Mircea

Re: XProc 3 as a copy of XProc framework but with RNC file from XProc 3 spec

Posted: Mon Feb 24, 2020 10:40 am
by Martin Honnen
Yes, I understand there is no XProc 3 engine yet, but as a beta version III of MorgaxXProc has been announced for the end of this month I wanted to see whether I can learn to at least write and edit some XProc 3 code with the help of oXygen and the schema I linked to.

If the schema for XProc 1 is hardcoded, I guess I won't be able to use a copy or extension of the XProc document framework in oXygen 22.

Nevertheless, should it be possible to write XProc 3 documents as normal XML documents referencing the schema with <?xml-model?>?

I have also tried that but it seems I run into some errors from Jing:

Code: Select all

System ID: C:\SomePath\XProc3\xproc30.rnc
Main validation file: C:\SomePath\XProc3\some-file.xml
Engine name: Jing
Severity: error
Description: an "element" pattern containing an "attribute" pattern with a non-null ID-type must have a name class that contains only "choice" and "name" elements
Start location: 483:3

System ID: C:\SomePath\XProc3\xproc30.rnc
Main validation file: C:\SomePath\XProc3\some-file.xml
Engine name: Jing
Severity: error
Description: an "element" pattern containing an "attribute" pattern with a non-null ID-type must have a name class that contains only "choice" and "name" elements
Start location: 473:3

System ID: C:\SomePath\XProc3\xproc30.rnc
Main validation file: C:\SomePath\XProc3\some-file.xml
Engine name: Jing
Severity: error
Description: conflicting ID-types for attribute "id" from namespace "http://www.w3.org/XML/1998/namespace" of element "load" from namespace "http://www.w3.org/ns/xproc"
Start location: 514:3

System ID: C:\SomePath\XProc3\xproc30.rnc
Main validation file: C:\SomePath\XProc3\some-file.xml
Engine name: Jing
Severity: error
Description: conflicting ID-types for attribute "id" from namespace "http://www.w3.org/XML/1998/namespace" of element "load" from namespace "http://www.w3.org/ns/xproc"
Start location: 508:14
Would such errors prevent any content completion from working?

Re: XProc 3 as a copy of XProc framework but with RNC file from XProc 3 spec

Posted: Mon Feb 24, 2020 11:11 am
by Mircea
Hello,

In order for the schema to be validated you need to go in the Options/Preferences/XML/XML Parser/RELAX NG and disable the Check ID/IDREF option.

Then create a new XML file, and associate the XProc 3.0 schema.
The file should be like:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="xproc30.rnc" type="application/relax-ng-compact-syntax"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:s="http://www.w3.org/ns/xproc-step" version="3.0">
</p:declare-step>
The xml-model should point to the location where your schema is located.

Re: XProc 3 as a copy of XProc framework but with RNC file from XProc 3 spec

Posted: Mon Feb 24, 2020 11:43 am
by Martin Honnen
Thanks, Mircea , after disabling the ID/IDREF check I can use the schema with the <?xml-model?> directive.