CSS (oxy_)xpath: use of current()

Oxygen general issues.
StefanKlatt
Posts: 2
Joined: Wed May 09, 2018 11:10 am

CSS (oxy_)xpath: use of current()

Post by StefanKlatt »

Dear “colleagues”
At our university we are developing a medical dialect.
In the past we were using relatively complex CSS-Statements (for authoring) that made use of current().
This worked fine in another editor, that supported current() from XSLT/Xpath also in CSS.
Here is an example (automatic pseudo-numbering of comment paragraphes)

content: xpath("count(//ns:Comment[count(following-sibling::ns:Comment[attribute::Id = current()/@Id])> 0])+1")

Does anyone see a way to realize this with oxy_xpath? The matter is "current()"
Stefan
Radu
Posts: 9436
Joined: Fri Jul 09, 2004 5:18 pm

Re: CSS (oxy_)xpath: use of current()

Post by Radu »

Hello Stefan,

We do not have an equivalent of the current() XSLT function in XPath but we do have the possibility to create the xpath by merging together multiple values.
Something like this:

post41199.html#p41193

meaning in your case something like:

Code: Select all

oxy_xpath(oxy_concat("count(//ns:Comment[count(following-sibling::ns:Comment[attribute::Id = '", attr(Id),"])> 0])+1"))
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
StefanKlatt
Posts: 2
Joined: Wed May 09, 2018 11:10 am

Re: CSS (oxy_)xpath: use of current()

Post by StefanKlatt »

Hey Radu,

thanks for this solution - f.e. it works fine with

content: oxy_xpath(oxy_concat("//sources:entry[attribute::id='",attr(idRef),"']/child::*/string()"))

for the visualisation of @id / @idRef pairings in author mode.

Regards

Stefan
Post Reply