Closed guenterh closed 4 years ago
Hints are welcome if you know more elegant possibilities to express match ranges matches(@code, '[b-su-z8]') in XSLT compared to the way I have
Not exactly sure but if you meant to abbreviate this:
<data source="811??.b|811??.c|811??.d" />
you can use character classes:
<data source="811??.[bcd]" />
Re: case1 vs. case2: A bit complex, this. I admit to not totally forsee the result of a complex combination of attributes and their parameters myself! So at that point I just modify&run&test until the result is satisfactory.
I don't understand what the problem is:
Since the result of the two cases are also very different (case1
: every matched field of all entities are entity-indistinguishable put into a set, while case2
puts one concatenated string per entity into the set) you evidently use two different approaches.
Nevertheless here some remarks:
In case1
you use <data source="950??.e"/>
in the concat
section while flushing with (in principle) every 950-subfield
(I think). As 950??.e
happens to be the last entry of all 950-entities and it must be concatenated before the concatenated string is flushed ("saturation" - I think this is so, not exactly sure) the "flushing" coincides with what would be better declared as ... flushWith="950??.e" >
(because of the clearness of it).
It's sometimes hard to explain and understand complex data transformations, I know. I would find it easier if you would have a question like "I have this data and want this outcome - how to do it?". But I gather you want more of the deeper understanding which I find hard for myself. Maybe you haven't read http://b3e.net/metamorph-book/latest/datamodel.html yet? I haven't yet - seems to be interesting.
Closing this. Note that some of the problems described here may be solved by newer documentation at https://github.com/metafacture/metafacture-core/wiki/Metamorph-Cookbook.
reset
,flushWith
andsameEntity
attributes on the various collector artefacts but also on the entity tag of MetamorphflushWith
andreset=true
is used in the MorphScript_case_1 whereassameEntity=true
andreset=false
delivers the correct result in this Morph script_case_2combine
uses thesameEntity=true
attribute for collecting the various values of anEntity
in combination with anIf
Statement (and no inside collectors) whileconcat
needs theflushWith
Attribute in combination withIF
andcombine
withreset=true
attribute as the outer collectorThanks for any replies!!
Günter