Skip to content

XQuery: Index access for integers #2069

Open
@ChristianGruen

Description

@ChristianGruen

If the string value of an XML path is always an integer …

index:facets('factbook')//
  element[@name = 'country']/
  attribute[@name = 'population']

… a numeric comparison …

db:open('factbook')//country[@population = 3249136]

… can be rewritten for index access:

db:attribute('factbook', '3249136')/self::attribute(population)/parent::country

Simple range queries could be rewritten as well:

db:open('factbook')//city/population
  [@year >= 82 and @year <= 84]

→ db:attribute('factbook', ('82', '83', '84'))/self::attribute(year)/parent::population[parent::city]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions