Xpath expressions help

hi i have a yang model which looks like

container one {
                presence "true";
                uses somegroup {
                    refine somegroupleaf  {
                        tailf:cli-delete-container-on-delete;
                        tailf:cli-diff-delete-before "../../one";
                        }
                }
        }


container two {
                presence "true";
                uses somegroup {
                    refine somegroupleaf  {
                        tailf:cli-delete-container-on-delete;
                        tailf:cli-diff-delete-before "../../two";
                        }
                }
        }

etc…,

how can i make this generic

tailf:cli-diff-delete-before “…/…/two”; instead specifying “two” in the xpath, how can i express to pick its parent.

Also where can i learn about Xpaths for yang and what expressions are valid ?

Thanks for help.

I don’t see why plain ".." would not work. Except that I don’t think you have to do that, the command line for the container deletion should not appear before its descendant under normal circumstances.

As for XPath documents - YANG uses standard XPath 1.0, I’m sure you can find lots of tutorials out there. Sometimes usable XPath expressions are restricted in what predicates can be used (or no predicates at all) - for standard YANG statements it is always indicated so in the corresponding section in the YANG RFC, for tailf:… extension statements read its definition in tailf_yang_extensions or tailf_yang_cli_extensions man page (or in the corresponding YANG module).