Name

xquery — Metaproxy Module for performing record transform using XQuery

DESCRIPTION

This filter performs record transforms on XML records using XQuery. The module is based on Zorba.

Configurable values:

<elementset name="name1" backend="name2"/>

Specifies the elementset (name1) that triggers the transform. Note that the record syntax must be XML as well. The 2nd element set, name2, specifies the element set that is sent to the next filter in chain (backend).

<script name="name"/>

The full path of the XQuery script to be invoked. This is required and should be set exactly once.

<record name="var"/>

The name of the XQuery variable where the input XML record is stored. This is required and should be set exactly once.

<variable name="name" value="value"/>

Sets XQuery variable name to value. This is set before each record is converted. This setting may be repeated to set multiple variables.

SCHEMA

# Metaproxy XML config file schema

namespace mp = "http://indexdata.com/metaproxy"

filter_xquery =
  attribute type { "xquery" },
  attribute id { xsd:NCName }?,
  attribute name { xsd:NCName }?,
  element mp:elementset {
    attribute name { xsd:string },
    attribute backend { xsd:string },
  },
  element mp:script {
    attribute name { xsd:string },
  },
  element mp:record {
    attribute name { xsd:string },
  },
  element mp:variable {
    attribute name { xsd:string },
    attribute value { xsd:string },
  }*


   

EXAMPLES

Configuration for converting MARCXML to BIBFRAME.

<filter type="xquery">
  <elementset name="bibframe" backend="marcxml"/>
  <script name="/usr/share/marc2bibframe/xbin/zorba3-0.xqy"/>
  <record name="marcxmluri"/>
  <variable name="serialization" value="rdxml"/>
  <variable name="baseuri" value="http://id.loc.gov/resources/bibs/"/>
  <variable name="usebnodes" value="true"/>
</filter>

   

SEE ALSO

metaproxy(1)