metafacture / metafacture-core

Core package of the Metafacture tool suite for metadata processing.
https://metafacture.org
Apache License 2.0
71 stars 34 forks source link

Metamorph: dynamic values for name attributes possible? #431

Open guenterh opened 8 years ago

guenterh commented 8 years ago

Thanks for any response!

Günter

cboehme commented 8 years ago

Hi Günter,

there are a number of ways to generate literal and entity names from the data values received.

<combine name="${NAME}" value=${VALUE}">
  <data source="name-source-field" name="NAME" />
  <data source="value-source-field" name="VALUE" />
</combine>
<entity>
  <entity-name>
     <data source="name-source" />
  </entity-name>
  <data soource="entity-contents" />
</entity>
<data source="021A.p">
 <switch-name-value />
</data>

If this statement receives the literal 021A.p=Personalname, it will output Personalname=021A.p.

<data source="021A.p">
 <constant value="foo" />
 <switch-name-value />
</data>

Receiving the same literal as above, this statement will produce the output foo=021A.p. It first set the output value to foo and than changes name and value, so foo becomes the new name and 021A.p the value.

I hope, this helps. If you need more examples for the <switch-name-value> statement, let me know.

Best, Christoph

dr0i commented 7 years ago

Hello @guenterh, could you solve your issue following these hints? Then you could close the issue.

dr0i commented 2 years ago

I think @cboehme answered this question sufficiently and we can use this in out documentation.

TobiasNx commented 2 years ago

I think @cboehme answered this question sufficiently and we can use this in out documentation.

I moved this ticket since it was residing in documentation and was not related to the documentation repo. If this ticket is answered well enough we can close it.

dr0i commented 2 years ago

documentation and was not related to the documentation repo.

hm, I could have thought to collect scenarios and questions of users with a receipt to solve those. Wouldn't that be good for the documentation?

TobiasNx commented 2 years ago

If so then this example should be part of the cookbook and no open issue.

dr0i commented 2 years ago

Yes - someone has to transfer the helpful content to the cookbook :)