XProc and XQuery

Issues related to W3C XQuery.
Dill
Posts: 7

XProc and XQuery

Tue Aug 23, 2016 8:13 pm

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: 2326

Re: XProc and XQuery

Wed Aug 24, 2016 5:17 pm

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

Return to “XQuery”

Who is online

Users browsing this forum: No registered users and 0 guests