Page 1 of 1

oxygen giving incorrect syntax error for xproc?

Posted: Mon Jul 23, 2018 4:05 pm
by paten
Hello,
I am using Roger Costello's XProc tutorial. Things were going fine until I got to his examples for validate-with-schematron. Oxygen is showing an error for the parameters ports.

Code: Select all

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
<p:input port="source">
<p:document href="document.xml"/>
</p:input>
<p:output port="result">
<p:pipe step="checkReservedWords" port="result"/>
</p:output>


<p:validate-with-schematron phase="classificationValidation" name="checkClassifications">
<p:input port="schema">
<p:document href="check-classifications-and-reserved-words.sch"/>
</p:input>
<p:input port="parameters" sequence="true">
<p:empty/>
</p:input>
</p:validate-with-schematron>


<p:validate-with-schematron phase="reservedWordValidation" name="checkReservedWords">
<p:input port="source">
<p:pipe step="checkClassifications" port="result" />
</p:input>
<p:input port="schema">
<p:document href="check-classifications-and-reserved-words.sch"/>
</p:input>
<p:input port="parameters" sequence="true">
<p:empty/>
</p:input>
</p:validate-with-schematron>

</p:declare-step>
The error message is: attribute "sequence" not allowed here; expected attribute "select", "use-when", "xml-base" or xml:id" or an attribute from another namespace.

I looked at the specification on the w3 site and it shows the parameters port as having an attribute called "kind" (not "sequence"). When I substitute "kind" for "sequence", I get a similar error. I don't know if "kind" is a true syntax error or if oXygen is making a mistake. I'm also not sure how to find out.

Thanks for any guidance you can give me.

Regards,
Paten

Re: oxygen giving incorrect syntax error for xproc?

Posted: Mon Aug 06, 2018 1:28 pm
by Radu
Hi Paten,

We are not very familiar with the XProc standard as we do not use it much internally.
By default Oxygen uses a Relax NG schema to validate XProc documents. If you create a transformation scenario of type "XProc" for your XProc file, and then validate the XProc file again, then Oxygen will directly use the Calabash XProc engine for validation and indeed this engine no longer reports the problems you found.
I'll add an issue on our side to see if we can update the RNG schema we use by default for XProc validation so that such problems are no longer reported.

There is also an XProc developers list to which you could register and ask XProc-related questions:

https://xmlcalabash.com/

Regards,
Radu

Re: oxygen giving incorrect syntax error for xproc?

Posted: Mon Aug 06, 2018 1:42 pm
by Radu
Hi,

Looking more at the Relax NG schemas developed by Norman Walsh that Oxygen uses by default for validation, it seems that those two attributes are allowed when you have an input declaration like for example:

Code: Select all

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0">
<p:input port="source" sequence="true">
<p:document href="document.xml"/>
</p:input>

</p:declare-step>
but not when you have a connection to an existing input (which is your case).
I will try to get Norman Walsh (the creator of the Calabash XProc engine and member of the XProc committee) to give us some feedback on this one.

Regards,
Radu

Re: oxygen giving incorrect syntax error for xproc?

Posted: Mon Aug 06, 2018 3:01 pm
by paten
Thank you for your assistance.

Re: oxygen giving incorrect syntax error for xproc?

Posted: Thu Aug 09, 2018 12:01 am
by ndw
Hi,

Oxygen support asked me to chime in. Perhaps Roger's tutorial is out-of-date. I confess I haven't looked at it recently. The attributes 'kind', 'sequence', and 'primary' are only allowed on the declarations of steps, not on invocations of those steps. (If you declare that a port accepts a sequence, then every instance of that port on that step accepts a sequence.)

In your example, if you simply remove @sequence from the two uses in <p:validate-with-schematron>, your pipeline will be valid and will behave correctly.

If XML Calabash doesn't give you an error for those extraneous attributes, that's a bug in XML Calabash.

Hope that's helpful.

P.S. In the next version of XProc, we've changed the element names. You use p:input on the declaration and p:with-input on the invocation. (Parallel to p:option and p:with-option.) We hope that simplifies things.

Re: oxygen giving incorrect syntax error for xproc?

Posted: Thu Aug 09, 2018 7:54 am
by Radu
Hi Norman,

Thanks for the explanations, I added an issue on the Calabash issues list in order to have a record for this:

https://github.com/ndw/xmlcalabash1/issues/279

Oh, and I also wrote to Roger Costello to check out this thread, maybe he can update the tutorial on his side.

Regards,
Radu

Re: oxygen giving incorrect syntax error for xproc?

Posted: Thu Aug 09, 2018 3:06 pm
by paten
Thank you for the explanation of the changes in syntax. I appreciate you taking the time to reply.

Cheers
Paten