diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/expected.json b/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/expected.json new file mode 100644 index 00000000..4481c428 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/expected.json @@ -0,0 +1,7 @@ +{ + "elementA" : "Test" +} +{ + "elementA" : [ "Test", "Another Test" ], + "elementB" : "Hello" +} diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/input.xml b/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/input.xml new file mode 100644 index 00000000..56b9f08c --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/input.xml @@ -0,0 +1,10 @@ + + + + Test + + + Test + Another Test + + diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/test.fix b/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/test.fix new file mode 100644 index 00000000..c3c5e3b2 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/test.fix @@ -0,0 +1,3 @@ +if is_array("elementA") + add_field("elementB", "Hello") +end diff --git a/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/test.flux b/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/test.flux new file mode 100644 index 00000000..1d8c3df8 --- /dev/null +++ b/metafix/src/test/resources/org/metafacture/metafix/integration/conditional/fromXml/toJson/ifIsArraySimple/test.flux @@ -0,0 +1,8 @@ +FLUX_DIR + "input.xml" +|open-file +|decode-xml +|handle-marcxml +|fix(FLUX_DIR + "test.fix") +|encode-json(prettyPrinting="true") +|write(FLUX_DIR + "output-metafix.json") +;