200-901 · Question #438
Refer to the exhibit. The YANG module devnet-users shows a data model for user accounts. Which code snippet shows the XML representation of an instantiation of the YANG data model? A. B. C. D.
The correct answer is D. <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <users xmlns:ex="http://devnet.com/devnet-users"> <ex:person> <ex:name>User One</ex:name> <ex:creationdate>2020-08-24T00:00:00-00:00</ex:creationdate> </ex:person> <ex:person> <ex:name>User Two</ex:name> <ex:creationdate>2020-10-05T07:00:00-00:00</ex:creationdate> </ex:person> </users> </data>. NETCONF XML encoding of YANG data requires proper namespace declaration and consistent application of namespace prefixes to all elements belonging to the YANG module.
Question
Refer to the exhibit. The YANG module devnet-users shows a data model for user accounts. Which code snippet shows the XML representation of an instantiation of the YANG data model? A. B. C. D.
Exhibits
Options
- A<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <users xmlns="http://devnet.com/devnet-users"> <person> <name>User One</name> <creationdate>2020-08-24T00:00:00-00:00</creationdate> </person> <person> <name>User Two</name> <creationdate>2020-10-05T07:00:00-00:00</creationdate> </person> </users> </data>
- B<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <users xmlns="http://devnet.com/devnet-users"> <person> <name>User One</name> <creationdate>2020-08-24T00:00:00-00:00</creationdate> </person> <person> <name>User Two</name> <creationdate>2020-10-05T07:00:00-00:00</creationdate> </person> </users> </data>
- C<data yang-model="urn:ietf:params:xml:devnet-users"> <users xmlns="http://devnet.com/devnet-users"> <person> <name>User One</name> <creationdate>2020-08-24T00:00:00-00:00</creationdate> </person> <person> <name>User Two</name> <creationdate>2020-10-05T07:00:00-00:00</creationdate> </person> </users> </data>
- D<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <users xmlns:ex="http://devnet.com/devnet-users"> <ex:person> <ex:name>User One</ex:name> <ex:creationdate>2020-08-24T00:00:00-00:00</ex:creationdate> </ex:person> <ex:person> <ex:name>User Two</ex:name> <ex:creationdate>2020-10-05T07:00:00-00:00</ex:creationdate> </ex:person> </users> </data>
How the community answered
(23 responses)- A13% (3)
- B9% (2)
- C4% (1)
- D74% (17)
Why each option
NETCONF XML encoding of YANG data requires proper namespace declaration and consistent application of namespace prefixes to all elements belonging to the YANG module.
Choice A declares the namespace as a default namespace (xmlns=) on the 'users' element without using an explicit prefix, which differs from the proper explicit prefix notation required by this YANG data model instantiation.
Choice B repeats the same default namespace structure as A and likewise lacks the explicit namespace prefix notation needed for correct YANG XML representation in this context.
Choice C uses 'yang-model' as an attribute name instead of the standard 'xmlns', which is not valid XML namespace syntax and is unrecognized by NETCONF parsers.
Choice D correctly binds the module namespace to a prefix (xmlns:ex='http://devnet.com/devnet-users') and explicitly applies 'ex:' to every child element - person, name, and creationdate - unambiguously associating each with the YANG module's namespace. This explicit prefix notation follows RFC 7950 and RFC 6241 conventions for representing YANG-modeled data in XML over NETCONF. It avoids namespace inheritance ambiguity that can occur with default namespace declarations in nested structures.
Concept tested: YANG data model XML instantiation with namespace prefixes
Source: https://www.rfc-editor.org/rfc/rfc7950
Topics
Community Discussion
No community discussion yet for this question.




