XProc and XQuery

Issues related to W3C XQuery.
Dill
Posts: 7
Joined: Tue Aug 23, 2016 8:08 pm

XProc and XQuery

Post by Dill »

I try to run xquery from xproc.
But with the files below I get the error "Content is not allowed in prolog" in the file hello.xquery.
It seems like a wrong saxon version is used (which can't handle xquery)
What to do?

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<test>Hello, World!</test>

Code: Select all


/test

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step"
version="1.0">
<p:input port="source">
<p:document href="hello.xml"/>
</p:input>
<p:output port="result" sequence="true"/>
<p:xquery>
<p:input port="query">
<p:document href="hello.xquery"/>
</p:input>
<p:input port="parameters">
<p:empty/>
</p:input>
</p:xquery>
</p:declare-step>
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: XProc and XQuery

Post by adrian »

Hi,

You cannot use p:document/@href to point to an XQuery script, p:document only works with XML files, hence the "Content is not allowed in prolog." XML parser error.
You should use p:data/@href instead:

Code: Select all

<p:input port="query">
<p:data href="hello.xquery"/>
</p:input>
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply