Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with bare axis names (XPath 1.0) #54

Closed
achernavin22 opened this issue Nov 6, 2018 · 4 comments
Closed

Issue with bare axis names (XPath 1.0) #54

achernavin22 opened this issue Nov 6, 2018 · 4 comments
Labels

Comments

@achernavin22
Copy link

If you have a node in your scheme that has a name of one of
the axes, it leads to an invalid path. For instance, for the child axis:

/ipsec-config/tunnel[instance='1']/crypto/ike/child/name

Sorry, I don't have the exact error now but it was something like this:

... clixon_xpath_parseerror ... line 1 ... after or before "/"

At the same time, this path is considered as valid:

/ipsec-config/tunnel[instance='1']/crypto/ike/proposals/name

Both "child" and "proposals" are lists.

@olofhagsand
Copy link
Member

@achernavin22 please supply yang spec (or part of it - is that ietf-ipsec@2016-03-09.yang?) and preferably action leading to the error? (eg a configuration or cli commands).

@achernavin22
Copy link
Author

achernavin22 commented Nov 6, 2018

YANG spec:

container ipsec-config {
    list tunnel {
        key "instance";
        leaf instance {
            type uint32;
        }
        ...
        container crypto {
            ...
            container ike {
                ...
                list proposals {
                    key "name";
                    leaf "name" {
                        type string;
                    }
                    ...
                }
                ...
                list child {
                    key "name";
                    leaf name {
                        type string;
                    }
                    ...
                }
            }
        }
    }
}

Can be reproduced having this in your clispec file (try to TAB or execute the command):

<name:string expand_dbvar("candidate","/ipsec-config/tunnel=%s/crypto/ike/child=%s/name")>

@olofhagsand
Copy link
Member

Confirmed: "If you have a node in your scheme that has a name of one of the axes, it leads to an invalid path."
Need some more time to fix this.

@olofhagsand
Copy link
Member

This is fixed for axis-names. However, I think there may be other corner-cases since https://www.w3.org/TR/xpath-10 is somewhat tricky in this respect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants