Closed TobiasNx closed 3 years ago
I can confirm this issue in another case.
<record>
<contribution>
<type>Contribution</type>
<agent>
<label>Halfbrodt, Michael</label>
<type>Person</type>
<gndIdentifier>1038509653</gndIdentifier>
<id>https://d-nb.info/gnd/1038509653</id>
</agent>
</contribution>
</record>
results in
<record>
<type>
<value>Contribution</value>
</type>
<label>
<value>Halfbrodt, Michael</value>
</label>
<type>
<value>Person</value>
</type>
<gndIdentifier>
<value>1038509653</value>
</gndIdentifier>
<id>
<value>https://d-nb.info/gnd/1038509653</value>
</id>
</record>
A solution would be nice.
For a possible solution repeated fields/subfields should not be overwritten. flattend
is doing this
ping @blackwinter , if you want to have a look
I'd like to, but I don't know when I will find the time...
It might be helpful if someone could prepare a (failing) test case in org.metafacture.metamorph.TestMetamorphBasics
.
I have set up a sample repo: https://github.com/TobiasNx/notWorkingFlux/tree/main/elseNested_Xml2JSON @dr0i could create the test from this
I've looked into this a bit over the weekend. Apparently, it's not like this hadn't been anticipated (sort of):
Also, there's the question of nested entities (more than one entity marker in the path), but I won't get into it here...
_Originally posted by @blackwinter in https://github.com/metafacture/metafacture-core/pull/333#discussion_r503248019_
Oops... :innocent:
I'll try to come up with a PR in the next couple of days.
With _elseNested
, entities are only output when an unhandled literal occurs. The issue was that then only the last (current) entity was taken into account. Now all intermediate entities are included as well.
If operating with a file with more than 2 hierachy levels
_elseNested
reduces this structure to 2 levels:Input:
FLUX:
MORPH:
OUTPUT:
If decoded as JSON: