From 4395c1fad0b92f0f7084ca9d70e6e26f61007513 Mon Sep 17 00:00:00 2001 From: niamhcore Date: Wed, 5 May 2021 11:42:20 +0100 Subject: [PATCH] Document ancestor cps path Issue-ID: CPS-305 Signed-off-by: niamhcore Change-Id: I29ef0c62ab2030d900c9fcecb453d9aff9f647d3 --- docs/cps-path.rst | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/cps-path.rst b/docs/cps-path.rst index 160aa9389..aec87cd43 100644 --- a/docs/cps-path.rst +++ b/docs/cps-path.rst @@ -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**: ``///ancestor::`` + - ``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 -- 2.16.6