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

namespace missing in exception messages for XML documents #77

Open
kwatsen opened this issue Dec 15, 2020 · 3 comments
Open

namespace missing in exception messages for XML documents #77

kwatsen opened this issue Dec 15, 2020 · 3 comments

Comments

@kwatsen
Copy link
Contributor

kwatsen commented Dec 15, 2020

[This is happening in my fork. I haven't tested against yangson/master yet]

The path provided in an error message from SchemaNode.from_raw() with an input document that has an unexpected leaf node:

    /ietf-sztp-bootstrap-server:input/foo-bar

The path provided in an error message from SchemaNode.from_xml() with an input document that has an unexpected leaf node:

    /input/foo-bar

The XML code should provide the namespaces in the same way. This may be related to the more general issue about how the XML code is inconsistent with how namespaces are represented in the ET structures: sometimes the namespace is in the attrib and sometime it's mangled into the tag.

@kwatsen kwatsen mentioned this issue Feb 11, 2021
@kwatsen
Copy link
Contributor Author

kwatsen commented Mar 13, 2021

In case there's any question, this is still an open issue.

My project has a unit test that accommodates the unexpected exception message. I'll know this issue is fixed when that unit test starts failing...

@nhathaway
Copy link

nhathaway commented Feb 18, 2025

I don't know if this is the same issue, but I can feed this into from_raw:

{
    "ietf-hardware:hardware": {
        "component" : [{
            "name": "my-name",
            "class": "o-ran-hardware:O-DU-COMPONENT",
            "o-ran-hardware:o-ran-name": "my-oran-name"
        }]
    }
}

and it is happy, but it fails if I feed the equivalent into from_xml:

<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <hardware xmlns="urn:ietf:params:xml:ns:yang:ietf-hardware">
    <component>
      <name>my-name</name>
      <class xmlns:o-ran-hw="urn:o-ran:hardware:1.0">o-ran-hw:O-DU-COMPONENT</class>
      <o-ran-name xmlns="urn:o-ran:hardware:1.0">my-oran-name</o-ran-name>
    </component>
  </hardware>
</data>

It fails with a namespace missing exception on class, which is an identyRef,.

I can send you [email protected], though it won't accept it here. (It is publicly available on the internet)

@nhathaway
Copy link

In addition, on any system running netopeer2, if you do a netconf get with a subtree filter of either of these two:

<yang-library xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library"/>

or

<sysrepo-state xmlns="http://www.sysrepo.org/yang/sysrepo-monitoring"/>

then the form_xml on the result will always fail.

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

No branches or pull requests

2 participants