Skip to content

Syntax error in a map with if expression without brackets #91

@frankweenink

Description

@frankweenink

When using an if expression in a map without brackets it is reported as a problem while it's a valid XPATH expression:

XPath: Expression context - unexpected token here [line,column]

where [line,column] in this example points to the last colon

<xsl:variable name="example" select="map {
      'a' : if (true()) then 1 else 2,
      'b' : 2
  }"/>

A workaround is to use brackets around the if expression:

  <xsl:variable name="example" select="map {
      'a' : (if (true()) then 1 else 2),
      'b' : 2
  }"/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions