I use pyang's yang2dsl for validating input xml instances against yang data model. But, it throws error when the order of the parameters in the xml instances is not the same as in yang model. Is there an option to make it ignore the order of parameters? Here's my xml code(example.xml):
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="100">
<action>
<param1>aaa</param1>
<param2>bbb</param2>
</action>
</rpc>
Here's my YANG model, example.yang(I've pasted only the part it's compared against for brevity):
module example {
rpc action {
input {
leaf param2 {
type string
}
leaf param1 {
type string
}
}
}
yang2dsdl -t rpc example.yang The schemas are generated successfully.
yang2dsdl -s -j -b example -t rpc -v example.xml
error: element "param1" not allowed yet; missing required element "param2"
Though param1 and param2 are in the input xml file, as they are not in the same order as in YANG model, it throws errors.
Can someone tell me how to solve this problem?