I've been having this issue using Filter By Attribute, and I'm not sure if it's because I'm using the tool incorrectly or simply a FrameMaker bug (but I suspect the former).
Basically, I import an XML document into FM that looks something like this:
<elem2 attr="true" />
<elem3 attr="false" />
<elem4 attr="true" />
And then I use Filter By Attribute to apply a condition (let's call it "Changed") to all the elements that have attr="true" using the expression: (attr="true"), and another condition ("Unchanged") to those with attr="false" using the expression: (attr="false")
However, the results I get are exactly the opposite! (attr="true") applies the "Changed" condition to all those elements that have the attr="false", and (attr="false") applies the "Unchanged" condition to those with attr="true".
If anyone could provide some insight on why this is happening, I would be very grateful.
You are not the only user who finds filter by attribute to be counterintuitive. The underlying model seems to assume you want to keep content matching an expression and filter out content that does not match. However, the only elements that are tested to see whether or not they match are those with values, explicit or default, for all the attributes mentioned in the expression.
Thus, filtered text seems to consist of elements that have values, explicit or defaulted, for all the attributes that appear in the applied expression but do NOT match that expression. Hence, if you want to apply condition Changed to elements that set attr to "true", use the expression NOT(attr="true"); to apply condition Unchanged, use the expression NOT(attr="false").To apply one or the other condition to every element that sets this attribute, apply both expressions.
If no default value for attr is assigned in FM (regardless of any default in XML), neither expression will apply a condition to an element that does not set the attribute. If there is a default value, the default will determine how elements that do not set the attribute are processed.
If you change the attribute setting, reapply the expressions, checking the Remove if Previously Applied box.
Just a suggestion... if you would like to see structure-based condition management done right (IMHO), you could try out my AXCM plugin. It is free and always will be:
I was originally excited when the filter-by-attribute feature was announced, because I thought maybe I could stop maintaining this plugin. No such luck, though. The Adobe implementation is really half-baked and I don't see how it could really be used in a high-demand, production environment.
Thanks for the tip Russ, I'll have to check that out! Is it supported in FM13?
Yes. The latest build was for FM11 but it worked fine on FM12 so I didn't get around to an FM12 build (for that and other reasons). Also, as far as I can tell, it continues to work fine on FM2015. I will eventually have a 2015-specific build but you should be OK with what is out there.
Russ -- I would love to use your axcm plugin but I have tried installing it on Frame 2015, and the menu does not show up at all. It does show up on my Frame 12 installation though --
But if we can't get it to work on Frame 2015, we'll have to wait an updated DLL, I think. I know it's free, so of course, I am not requesting one. 🙂
Russ -- BTW, I did get the menu to show up, but I had to put the AXCM plugin line as the last line under the API Clients list in maker.ini. Previously, we had Framescript as the last item.
Anyone know why the order matters?
I don't have any explanation for that behavior. I don't have FrameScript, so I can't test it out. I think the best I can say is that I'm glad you found a solution and I hope it keeps working
Your post motivated me to finally post FM2015 builds for all the plugins. I don't know if it will make any difference in your case but you can get a FM2015 build for AXCM now. Functionally, you shouldn't notice much change.