XPROC how get validation errors

Questions about XML that are not covered by the other forums should go here.
tazo
Posts: 1
Joined: Sat Nov 20, 2010 7:48 pm

XPROC how get validation errors

Post by tazo »

How retrieve validation errors from <p:validate-with-XXXX> ?
The example bellow from http://www.xfront.com/xproc/
just output INVALID, we want the errors instead!.

Code: Select all

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:c="http://www.w3.org/ns/xproc-step" version="10.0">
<p:input port="source">
<p:document href="BookStore.xml"/>
</p:input>
<p:output port="result" />
<p:try>
<p:group>
<p:validate-with-xml-schema assert-valid="true" mode="strict" name="myValidate">
<p:input port="schema">
<p:document href="BookStore.xsd"/>
</p:input>
</p:validate-with-xml-schema>
</p:group>
<p:catch>
<p:identity>
<p:input port="source">
<p:inline><c:result>invalid</c:result></p:inline>
</p:input>
</p:identity>
</p:catch>
</p:try>
</p:declare-step>
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: XPROC how get validation errors

Post by george »

Hi,

AFAIK it is not possible to get the validation errors, the result port will contain the source document with some enhancements, see
http://www.w3.org/TR/xproc/#c.validate-with-xml-schema
You will probably get them if you register an error listener on the XProc engine.
Try also posting a message on the xproc-dev@w3.org mailing list, you should get the final answer or a workaround there.

Best Regards,
George
George Cristian Bina
Post Reply