fn:xml-to-json example
✓ Published0🌍 Public
CCliffordAnderson
Last edited Aug 2, 2017
Created on Aug 2, 2017
This example demonstrates the transformation of a nested XML document into JSON using the XQuery 3.1 function `fn:xml-to-json`. The XML input encodes workshop information, including leaders and institutions, within a structured `<map>` and `<array>` hierarchy using the XPath Functions namespace. The function converts this XML representation directly into its JSON equivalent, preserving the nested array and map structure. The code relies on the standard XQuery 3.1 function library, with the source document defined inline and the transformed JSON output returned as the query result.
AI-generated description