Changes between Version 10 and Version 11 of XPATH


Ignore:
Timestamp:
Apr 17, 2009, 3:00:47 AM (15 years ago)
Author:
heikki
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • XPATH

    v10 v11  
    5757We should decide on this matter very soon.
    5858
     59=== Other considerations ===
     60
     61The above design decision is about how to relate an XPATH !LocationPath to a valid result set from the Lucene index. XPATH is a much larger language and supports many constructs that combine !LocationPaths (such as disjuncts), supports a set of built-in functions (for example arithmetic, like ''round()''), a set of operators (for example aritmetic, like ''mod''), and a set of ''axes'' which refer to other parts of the document in relation to the current node (such as ''following-sibling'').
     62
     63I have already created code for an XPATH interpreter that recursively processes an XPATH expression to the desired level, so it seems it won't be too difficult to support these 'advanced' features. The interpreter uses the [http://commons.apache.org/jxpath/ JXPath] library. An example is:
     64
     65input XPATH :
     66//rim:ExtrinsicObject[@objectType='urn:x-ogc:specification:csw-ebrim-cim:ObjectType:MetadataInformation']/rim:Slot[@name='http://purl.org/dc/elements/1.1/language' and @ slotType='urn:ogc:def:dataType:RFC-4646:Language']
     67
     68output interpreter :
     69
     70'locationpath': //rim:ExtrinsicObject[@objectType = 'urn:x-ogc:specification:csw-ebrim-cim:ObjectType:MetadataInformation']/rim:Slot[@name = 'http://purl.org/dc/elements/1.1/language' and @slotType = 'urn:ogc:def:dataType:RFC-4646:Language']
     71        step:  xpath axis:  descendant-or-self
     72        step: rim:ExtrinsicObject[@objectType = 'urn:x-ogc:specification:csw-ebrim-cim:ObjectType:MetadataInformation'] xpath axis:  child
     73operation 'compare': @objectType = 'urn:x-ogc:specification:csw-ebrim-cim:ObjectType:MetadataInformation' symbol: =
     74'locationpath': @objectType
     75        step: @objectType xpath axis:  attribute
     76'constant': 'urn:x-ogc:specification:csw-ebrim-cim:ObjectType:MetadataInformation'
     77        step: rim:Slot[@name = 'http://purl.org/dc/elements/1.1/language' and @slotType = 'urn:ogc:def:dataType:RFC-4646:Language'] xpath axis:  child
     78operation 'and': @name = 'http://purl.org/dc/elements/1.1/language' and @slotType = 'urn:ogc:def:dataType:RFC-4646:Language'
    5979
    6080
     
    6282
    6383
     84
     85