John L. Clark wrote:
> On Mon, Apr 11, 2005 at 05:25:13PM +0200, Jan Bares wrote:
>
>>I created custom CSS, if somebody cares, here is the content (I am new to
>>XPath):
>>
>>xref {
>>content: icon(left-link)
>>xpath("if(id(@linkend)/@xreflabel, id(@linkend)/@xreflabel,\
>>if(id(@linkend)/title, id(@linkend)/title,\
>>if(id(@linkend)/glossterm, id(@linkend)/glossterm, @linkend)))");
>>vertical-align: text-top; /* for the icon */
>>color: navy;
>>}
>
>
> I've followed this line of discussion with interest, because my users
> are also interested in this functionality. I am very curious about that
> if() construct that I have seen used in the various emails in this
> discussion, such as above. I've lived exclusively in XPath 1.0-land,
> and so I'd never seen that construct. Apparently it's an XPath 2.0
> feature, correct? The XXE CSS support documentation says that "XPath 1
> is fully supported, including id() and document()"; is there any
> documentation indicating what elements of XPath 2.0 are also supported?
>
> By the way, thank you for this snippet, Jan.
No, XPath 2.0 is absolutely not supported by XXE.
The if() function is a ``proprietary'' extension. These extensions are
documented in
http://www.xmlmind.com/xmleditor/_distrib/docs/commands/ch07s01.html
Note that the snippet sent by Jan could be rewritten as because the if()
is in fact a if/elsif/elseif/elseif/.../else:
---
xref {
content: icon(left-link)
xpath("if(id(@linkend)/@xreflabel, id(@linkend)/@xreflabel,\
id(@linkend)/title, id(@linkend)/title,\
id(@linkend)/glossterm, id(@linkend)/glossterm,\
@linkend)");
vertical-align: text-top; /* for the icon */
color: navy;
}
---
---
PS: In the snippet sent by Jan, displaying id(@linkend)/title seems
obvious, but why add id(@linkend)/glossterm? Why not add even more
elements? Is this what is done in Norman Walsh's XSLT style sheets?