Patterns in XSLT

  • Thread starter Michael Kragh Pedersen
  • Start date
M

Michael Kragh Pedersen

Is it not possible to use ?: in your group expressions in XSLT patterns,
like it is for example in JavaScript?

Michael K. P.
 
M

Martin Honnen

Michael said:
Is it not possible to use ?: in your group expressions in XSLT patterns,
like it is for example in JavaScript?

Certainly not in XSLT 1.0/XPath 1.0.

XPath 2.0 has
<http://www.w3.org/TR/xpath20/#id-conditionals>
so there you can write
if (testExpression) then expression1 else expression2
similar to Javascript's
testExpression ? expression1 : expression2

I haven't checked whether that would then be allowed inside of an XSLT
2.0 pattern.
 
M

Michael Kragh Pedersen

Martin said:
Certainly not in XSLT 1.0/XPath 1.0.

XPath 2.0 has
<http://www.w3.org/TR/xpath20/#id-conditionals>
so there you can write
if (testExpression) then expression1 else expression2
similar to Javascript's
testExpression ? expression1 : expression2

I haven't checked whether that would then be allowed inside of an XSLT
2.0 pattern.

Well, that's not what I mean, actually I was talking about the pattern
tag. In JavaScript, you can use ?: in regular expressions.
 
M

Martin Honnen

Michael said:
actually I was talking about the pattern
tag. In JavaScript, you can use ?: in regular expressions.

But XSLT 1.0/XPath 1.0 doesn't have regular expressions at all so I am
not sure what you are looking for.

Or are you asking about XSLT 2.0/XPath 2.0?
 
M

Michael Kragh Pedersen

Martin said:
But XSLT 1.0/XPath 1.0 doesn't have regular expressions at all so I am
not sure what you are looking for.

Or are you asking about XSLT 2.0/XPath 2.0?
Well, if only XSLT has regular expressions, it must be the one, Im
using, so yes :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top