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

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,839
Latest member
MartinaBur

Latest Threads

Top