Patterns in XSLT

Discussion in 'XML' started by Michael Kragh Pedersen, Mar 17, 2005.

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

    Michael K. P.
     
    Michael Kragh Pedersen, Mar 17, 2005
    #1
    1. Advertising

  2. Michael Kragh Pedersen wrote:

    > 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.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Mar 17, 2005
    #2
    1. Advertising

  3. Martin Honnen wrote:
    >
    >
    > Michael Kragh Pedersen wrote:
    >
    >> 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.
    >


    Well, that's not what I mean, actually I was talking about the pattern
    tag. In JavaScript, you can use ?: in regular expressions.
     
    Michael Kragh Pedersen, Mar 17, 2005
    #3
  4. Michael Kragh Pedersen wrote:

    > 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?


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Mar 17, 2005
    #4
  5. Martin Honnen wrote:
    >
    >
    > Michael Kragh Pedersen wrote:
    >
    >> 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?
    >
    >

    Well, if only XSLT has regular expressions, it must be the one, Im
    using, so yes :)
     
    Michael Kragh Pedersen, Mar 17, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stylus Studio
    Replies:
    0
    Views:
    681
    Stylus Studio
    Aug 3, 2004
  2. Benjamin Hillsley
    Replies:
    3
    Views:
    1,689
    Dimitre Novatchev
    Sep 25, 2003
  3. ted
    Replies:
    1
    Views:
    625
    Laurens
    Jan 26, 2004
  4. Replies:
    2
    Views:
    724
    Henry S. Thompson
    Oct 19, 2005
  5. crichmon
    Replies:
    4
    Views:
    486
    Mabden
    Jul 7, 2004
Loading...

Share This Page