Mark Fletcher wrote: > Can xpath() be used to retrieve a string for a property value rather > than for generated content? I can't get it to work, but maybe I'm doing > something wrong. > > What I'm trying to do is evaluate an xpath if() expression and return > (from an xml resourse file) the property value to apply. (I'm trying > this because the CSS selector syntax isn't powerful enough to do what I > need.) Is there any way to accomplish this?
Yes, the trick is to use the concatenate() (see http://www.xmlmind.com/xmleditor/_distrib/doc/csssupport/simple_dynamic.html) pseudo-function to evaluate what is returned by xpath() as a property value. Here's a simple XHTML example: --- body { display: block; } /* * Partial support for the Transitional DTD. */ body[bgcolor] { background-color: concatenate(xpath("./@bgcolor")); } body[text] { color: concatenate(xpath("./@text")); } ---

