exist
exist copied to clipboard
Implement fn:transform
Implements the fn:transform function specification
The transform function is complex, so we have chosen to structure it as a number of top level classes in their own
package, org.exist.xquery.functions.fn.transform which are invoked by the main org.exist.xquery.functions.fn.FnTransform class.
The implementation relies on the Saxon XSLT processing library to compile referenced stylesheet(s).
In highly simplified terms, the implementation:
- Reads and checks all the parameters/options to the function
- Invokes Saxon to compile the identified stylesheet
- Retrieves a transformer from the compilation
- Figures out which form of application of the stylesheet is required
- Constructs (a) delivery object(s) to build output according to the requested delivery format
- Calls Saxon again (the transformer this time) applying the stylesheet to the input
- Builds the result map using the contents of the delivery objects, and returns it
Unit Tests
A number of unit tests have been added, driven by the an attempt to test the same functionality as some of the individual XQTS tests efficiently during development. These tests do not provide complete coverage of the features
of fn:transform, and the XQTS tests should be considered as the truth.
XQTS Tests
The goal of the development of fn:transform has been to pass all the tests in the fn-transform test set of XQTS tests for transformation.
The tests are run with the eXist XQTS Runner
-
The test
fn-transform-68currently fails. We are satisfied that the behaviour exhibited by our code is correct, and that the test is deficient Issue -
All other tests from the
fn:transformtest set pass, except for 4 tests which are not run because they require features that eXist-db does not support (e.g. custom schema types in XQuery) .
This open source contribution to the eXist-db project was commissioned by the Office of the Historian, U.S. Department of State, https://history.state.gov/.
Be careful, you copied the W3C's "FOXT0001" error code too many times, I'm afraid ;-)
Thanks @brihaye I have fixed that now.
@alanpaxton Thank you for this PR and the truly Herculean effort that went into implementing this complex function!
it would be nice if we could get of the old unmaintained xalan lib.....









