Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New module: confectory-datamapper-saxon12 #177

Merged
merged 2 commits into from
Jul 6, 2024
Merged

Conversation

oswaldobapvicjr
Copy link
Owner

@oswaldobapvicjr oswaldobapvicjr commented Jul 6, 2024

New feature

Proposed solution

Introduce a new module confectory-datamapper-saxon12 for mapping XML sources using Saxon-HE 12 as a provider, allowing for an alternative for retrieving configuration using XPath 3.1.

The new module is dependent solely on confectory-datamapper-core.

Module Provider(s) Properties XML JSON YAML
confectory-datamapper-saxon12 Saxon-HE 12 -- YES -- --

Examples of usage

Loading an XML file

Sample file (conf.xml)
<config>
<host>localhost</host>
<port>1910</port>
<ssl>true</ssl>
</config>
Code sample:
Configuration<?> config = Configuration.builder()
                             .source("conf.xml")
                             .mapper(new SaxonXdmNodeMapper())
                             .build();

config.getBean(); // returns a XdmNode
config.getString("/config/host"); // returns "localhost"

@oswaldobapvicjr oswaldobapvicjr added the enhancement New feature or request label Jul 6, 2024
@oswaldobapvicjr oswaldobapvicjr self-assigned this Jul 6, 2024
@oswaldobapvicjr oswaldobapvicjr merged commit 9742bf7 into master Jul 6, 2024
4 checks passed
@oswaldobapvicjr oswaldobapvicjr deleted the issue/0177 branch July 6, 2024 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant