nerdexam
CiscoCisco

200-901 · Question #438

200-901 Question #438: Real Exam Question with Answer & Explanation

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.

Understanding and Using APIs

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.

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>

Explanation

NETCONF XML encoding of YANG data requires proper namespace declaration and consistent application of namespace prefixes to all elements belonging to the YANG module.

Common mistakes.

  • A. 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.
  • B. 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.
  • C. 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.

Concept tested. YANG data model XML instantiation with namespace prefixes

Reference. https://www.rfc-editor.org/rfc/rfc7950

Topics

#YANG#XML#Data Modeling

Community Discussion

No community discussion yet for this question.

Full 200-901 PracticeBrowse All 200-901 Questions