Search code examples
xqueryexist-db

Cannot complie xquery : err:XPST0003 the ':=' notation is no longer accepted in map expression


I'm trying eXist-db replication with ActiveMQ. When I configure for the consumer instance, it needs to execute a XQuery like this to register JMS receiver:

xquery version "3.0";
import module namespace replication="http://exist-db.org/xquery/replication" at "java:org.exist.jms.xquery.ReplicationModule"; 
let $jmsConfiguration := map {
    "java.naming.factory.initial" 
            := "org.apache.activemq.jndi.ActiveMQInitialContextFactory",
    "java.naming.provider.url" := "tcp://localhost:61616",
    "connection-factory" := "ConnectionFactory",
    "destination" := "dynamicTopics/eXistdb-replication-example",
    "subscriber.name" := "SubscriptionId",
    "connection.client-id" := "ClientId"
}

return
    replication:register($jmsConfiguration)

When I run this query, it returns an error like the title. I'm new to XQuery, so can you help me to check it ?


Solution

  • The notation map{ x := y, p := q } was used in an early draft of XSLT 3.0 and the notation was changed to map{ x : y, p : q } when it was adopted by XQuery. The error message suggests you are using an implementation that once supported the syntax from the draft spec, and later dropped it.

    If this is actually Saxon "under the hood", then the full error message is "The ':=' notation is no longer accepted in map expressions: use ':' instead", which tells you precisely what you need to do.