Document ancestor cps path 00/121100/3
authorniamhcore <niamh.core@est.tech>
Wed, 5 May 2021 10:42:20 +0000 (11:42 +0100)
committerNiamh Core <niamh.core@est.tech>
Thu, 6 May 2021 14:11:01 +0000 (14:11 +0000)
Issue-ID: CPS-305

Signed-off-by: niamhcore <niamh.core@est.tech>
Change-Id: I29ef0c62ab2030d900c9fcecb453d9aff9f647d3

docs/cps-path.rst

index 160aa93..aec87cd 100644 (file)
@@ -51,8 +51,8 @@ General Notes
 - String values must be wrapped in quotation marks (U+0022) or apostrophes (U+0027).
 - String comparisons are case sensitive.
 
-Supported Functions
-===================
+Supported Queries
+=================
 
 Get List Elements by Any Attribute Value
 ----------------------------------------
@@ -107,4 +107,25 @@ Get Any Descendant by Any Attribute Value
 
 **Limitations**
   - Only string and integer values are supported (boolean and float values are not supported).
-  - Multiple attributes can only be combined using 'and'. 'or' and bracketing is not supported.
\ No newline at end of file
+  - Multiple attributes can only be combined using 'and'. 'or' and bracketing is not supported.
+
+Query Extensions
+================
+
+Ancestor Axis
+-------------
+
+The ancestor axis can be added to any CPS path query.
+
+**Syntax**: ``//<cps-path>/ancestor::<ancestor-path>``
+  - ``cps-path``: Any CPS path query.
+  - ``ancestor-path``:  Partial path to ancestors of the target node. This can contain one or more ancestor nodes separated by a /.
+
+**Examples**
+  - ``//book/ancestor::categories``
+  - ``//categories[@genre="SciFi"]/book/ancestor::bookstore``
+  - ``book/ancestor::categories[@code=1]/books``
+
+**Limitations**
+  - Ancestor list elements can only be addressed using the list key leaf.
+  - List elements with compound keys are not supported.
\ No newline at end of file