Hey, Paul...
Sounds like you got something that works, but might not work for
different cases. I couldn't quite tell for sure from your description.
In any case, reading through your description of the problem made me
think of something you may want to consider. I don't know exactly how
Styler evaluates these conditions, but knowing that it allows a fair bit
of XPath in certain areas, I wonder if XPath rules might apply, here.
One thing to understand about XPath is that the expressions [@landscape
!= "yes"] and [not(@landscape = "yes")] can give different results.
Keep in mind that [@landscape] returns a node-set, which will contain
either zero nodes (if the "landscape" attribute is not specified on the
current element) or one node (if it is).
The expression [@landscape != "yes"] will be true if there is a
"landscape" attribute node whose string value (the value of the
attribute) is *not* equal to "yes". If there is no such attribute, the
expression will be false. The expression [not(@landscape = "yes")] will
be true if there is *not* a "landscape" attribute node whose string
value is equal to "yes". Note the slight difference in wording between
these two, as it is crucial. (Check out section 3.4 of the XPath 1.0
specification for all the details.)
If XPath semantics are at play with your Stylersheet, I can see why the
first expression would fail in the case where "landscape" is not set.
I'd try rewriting your condition as follows (up to you to translate this
from straight XPath back into Styler's syntax... still not using Styler,
here):
@pgwide = "yes" and not(ancestor::h1/@landscape = "yes") and
not(ancestor::h2/@landscape = "yes") and
not(ancestor::subhead/@landscape = "yes")
Hope this helps. Let me know if my crystal clear explanation got a
little muddy on its way through the email system. 😉
Brandon Ibach
Lockheed Martin Space Systems
Cape Canaveral, FL
321-476-7051