If you want to replace attributes instead of tags, you can use the attributes attribute to provide a space-separated list of attributes that should be replaced on the matched theme node(s).
I expected that the original div from the content is inserted on the theme but with these new classes.
But the end result is the unmodified div element on the theme.
<div id='myId' class='some others css and a new one'></div>
I'm doing something wrong? Or I misinterpreted the docs?
You need to post your full rules.xml file and index.html so we can make sense of it. A Github repo with your theme package would be even more helpful, in as to provide context.
Your rule seems right, however there are order of operations that may render it unused, or some other rule may be overwriting it (most likely).
Order of rules was linked already, thanks @jensens, but it could also be the case that you have another rule operating on the same element, or a container. Try to use the rule in a vanilla Plone site to get it rule working and with that you can confirm you have something masking it in your more complex theme.
I know that using xsl it's possible to solve the problem.
In fact it was the way that I solved.
What I want to understand is why that specific "attributes" attribute in replace don't work.
I made a mistake? the code is broken? it was removed and not documented? it has some specific situation to use?
I spent a lot of time to find this xsl alternative, while the documentation says that with just this command would solve my problem.
you code has 284 characters and attributes="class" has 18.
I like the golang philosophy, the less code you type, less bug your software has.
Note: As with rules working on tags, if the named attribute(s) do not exist on the both the theme and content nodes, nothing will happen. If you want to copy attributes regardless of whether they exist on the theme node(s) or not, you can use instead.
It's working on Tags, not on Attribute Selectors like on your Example. You should use XSLT