metafacture / metafacture-documentation

The central place for documentation about metafacture
http://metafacture.github.io/metafacture-documentation/
Apache License 2.0
3 stars 3 forks source link

metamorph: use and combination of reset, flushWith and sameEntity attributes #4

Closed guenterh closed 4 years ago

guenterh commented 8 years ago

Thanks for any replies!!

Günter

dr0i commented 8 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]" />
dr0i commented 8 years ago

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.

dr0i commented 4 years ago

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.