Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Saxon.XQuery
Runs a XML Query.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Saxon | 15.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
XML | The XML to work on. | ||
Query | The query to run. | ||
Namespaces | Available in MBS FileMaker Plugin 15.1 or newer. The list of namespaces to declare in the style Key=URL. |
Optional |
Result
Returns XML or error.
Description
Runs a XML Query.You can set the language version with Saxon.SetLanguageVersion function.
Set the current working directory with Saxon.SetCWD function, so the function can find relative files.
The query BaseURI can be set with Saxon.SetBaseURI function.
XQuery includes:
- XQuery 3.1 Minimal Conformance: Provides Minimal Conformance (including try/catch and "group-by", as well as language features retained from earlier XQuery versions) as defined in section 5 of the XQuery 3.1 specification.
- XQuery 3.1 Modules: Provides the Module feature, which allows a query to be made up of multiple modules.
- XQuery 3.1 Serialization: Provides the Serialization feature. This allows the output of a query to be serialized as lexical XML, or in other formats including HTML, JSON, and plain text, under the control of serialization parameters contained either in the query itself, or supplied externally.
- XQuery 3.1 Higher-Order: Provides the Higher-Order Function feature. This provides the ability to use functions as values, including dynamic function calls, inline functions, partial function application, and a library of built-in higher-order functions.
- Streaming with EE license: Provides saxon:stream(), an extension function to allow large documents to be processed without holding the whole document in memory.
Examples
Try a query:
Let([
xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<people>
<person dept=\"sales\">
<name> mary</name>
<age>20</age>
</person>
<person dept=\"marketing\">
<name>cindy</name>
<age>25</age>
</person>
<person dept=\"sales\">
<name>john</name>
<age>40</age>
</person>
<person dept=\"accounting\">
<name>peter</name>
<age>35</age>
</person>
</people>";
query = "for $i in /people/person¶
where $i/age > 30¶
return data($i/name)";
r = MBS( "Saxon.XQuery"; xml; query )
]; r)
Example result: <?xml version="1.0" encoding="UTF-8"?>john peter
See also
Example Databases
This function checks for a license.
Created 23th December 2024, last changed 31st January 2025
