Search

I've never been able to use axes properly in xPath like the following

parent::entry

while

../entry

works fine. Take this example

<xsl:if test="count(parent::entry) > 2">...

never works yet using ../ instead works every time. I've noticed this a few times in the past, but thought I'd share and ask...

Has anyone else seen this behaviour?

Well, parent::* is the same as .. while parent::*/entry would be the equivalent to ../entry.

.. goes up a level while ../entry goes up and then down again. I hope that makes sense. :-)

So the answer is

<xsl:if test="count(parent::/entry) > 2">...

Awesome.

@designermonkey: Have I told you lately that I love your avatar picture?

Why thank you!

Apparently, it looks like a baked potato with cress.

I always like to scale the avatars up, it makes it easier to see what is actually on them. Nice photo!

Scaling is useless. Still looks like a baked potato with cress. :-)

Hah!

No, I really like it!

I always like to scale the avatars up, it makes it easier to see what is actually on them. Nice photo!

Weird, when I scaled it up I got this...

LOL

Alright you lot. You're all in trouble!

LOL

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details