Example XQuery for Sara S.
✓ Published0🌍 Public
CCliffordAnderson
Last edited Aug 26, 2015
Created on Aug 26, 2015
This example shows how to extract a three-letter publication location code from a MARC 21 control field, filtering for specific geographic designators. It uses XQuery 3.1 with the `fn:substring` function to pull characters 16 through 18 from the text of the `marc:controlfield` element with `@tag='008'`. The query defines the MARC namespace and applies a `where` clause to return only codes matching `"gau"`, `"other"`, or `"codes"`. The source is a snippet of MARCXML data embedded directly in the script, demonstrating string parsing and conditional filtering in a pure XQuery environment.
AI-generated description