At the moment you cannot use makros in if-conditionals but also you also cannot create an makro that is only the if-conditional.
In context of lobid ressources - ALMA we needed to check for duplicates and wanted to reuse a small marko that we do not need to write the if-conditional again and again:
Caused by: org.xml.sax.SAXParseException; systemId: file:/home/tobias/git/lobid-resources/src/main/resources/alma/common/contribution.xml; lineNumber: 12; columnNumber: 64; cvc-complex-type.2.4.a: Invalid content was found starting with element 'call-macro'. One of '{"http://www.culturegraph.org/metamorph":group, "http://www.culturegraph.org/metamorph":data, "http://www.culturegraph.org/metamorph":all, "http://www.culturegraph.org/metamorph":any, "http://www.culturegraph.org/metamorph":choose, "http://www.culturegraph.org/metamorph":combine, "http://www.culturegraph.org/metamorph":concat, "http://www.culturegraph.org/metamorph":none, "http://www.culturegraph.org/metamorph":square, "http://www.culturegraph.org/metamorph":tuples, "http://www.culturegraph.org/metamorph":range, "http://www.culturegraph.org/metamorph":equalsFilter, "http://www.culturegraph.org/metamorph":containsFilter}' is expected.
We discussed how easily implement at least one form of combining if-conditionals and makros.
At the moment it seems that the option to allow makros in an if-conditional as we tried in our second attempt seems to be the easiest.
At the moment you cannot use makros in if-conditionals but also you also cannot create an makro that is only the if-conditional.
In context of lobid ressources - ALMA we needed to check for duplicates and wanted to reuse a small marko that we do not need to write the if-conditional again and again:
That did not work with:
We received:
Then we tried to create a makro for the condition of the if-conditional:
That did not work with:
We received:
We discussed how easily implement at least one form of combining if-conditionals and makros. At the moment it seems that the option to allow makros in an if-conditional as we tried in our second attempt seems to be the easiest.