You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just realised since we can get an instance of Elem, so is the way to iterate it (or transform it) the same as what we normally do? Like https://gist.github.com/zentrope/728034?
Yes, it's the same. Elem is regular xml node and behaves like one. The only difference is that it also contains special Unquote parts which corresponds to Scala expressions within XML.
Could you give an example that can loop on each element, and do some transformation?
Say, an XML:
Is it possible to write a macro, which can add the
id
attribute to each tag? An also change the content ofThis is header
.The final xml element will be:
The id value is not important, I just want to find a way to do something to each element, use pattern matching, like:
The text was updated successfully, but these errors were encountered: