Documentation Conventions for Expressing YANG in XML
draft-wu-netmod-yang-xml-doc-conventions-01

The information below is for an old version of the document
Document Type Active Internet-Draft (individual)
Last updated 2018-05-29
Replaced by draft-kwatsen-netmod-artwork-folding
Stream (None)
Intended RFC status (None)
Formats pdf htmlized bibtex
Stream Stream state (No stream defined)
Consensus Boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date
Responsible AD (None)
Send notices to (None)
Netmod Working Group                                               Q. Wu
Internet-Draft                                                    Huawei
Intended status: Best Current Practice                         A. Farrel
Expires: November 30, 2018                              Juniper Networks
                                                               B. Claise
                                                     Cisco Systems, Inc.
                                                            May 29, 2018

          Documentation Conventions for Expressing YANG in XML
              draft-wu-netmod-yang-xml-doc-conventions-01

Abstract

   Many documents that define YANG modules also include artwork examples
   presented in XML/JSON.

   IETF documentation has specific limits on line length and some
   artwork examples such as XML examples have to include line wraps that
   would not normally be allowed according to the XML representation
   rules of RFC7950 and RFC7952.The same applies to JSON.

   This document lays out documentation conventions that allow YANG
   examples to be presented in IETF documentation when XML/JSON encoded
   YANG data instance would otherwise exceed the maximum line length and
   provide consistent XML/JSON encoded YANG data node instance example
   within an Internet-Draft or RFC.  There are no implications in this
   document for YANG parsers: this document does not change the rules
   for presenting YANG models or for encoding YANG in data files or in
   the wire.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on November 30, 2018.

Wu, et al.              Expires November 30, 2018               [Page 1]
Internet-Draft       YANG Documentation Conventions             May 2018

Copyright Notice

   Copyright (c) 2018 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Conventions Used in this Document . . . . . . . . . . . . . .   3
   3.  Objectives  . . . . . . . . . . . . . . . . . . . . . . . . .   3
   4.  Separating Components of a Leaf Example . . . . . . . . . . .   4
   5.  Splitting an Example Leaf Node Value Across Lines . . . . . .   5
   6.  Representing XML and JSON Encodings of Metadata Annotations .   6
   7.  Mandatory Boilerplate for Splitting Leaf node value and
       Metadata Annotations  . . . . . . . . . . . . . . . . . . . .   7
   8.  Automatic Generation of Valid XML From Examples . . . . . . .   7
   9.  Security Considerations . . . . . . . . . . . . . . . . . . .   8
   10. IANA Considerations . . . . . . . . . . . . . . . . . . . . .   8
   11. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .   8
   12. Normative References  . . . . . . . . . . . . . . . . . . . .   9
   Appendix A.  Backslash appears in the node value not used for
                split line . . . . . . . . . . . . . . . . . . . . .   9
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  10

1.  Introduction

   YANG [RFC7950] defines four main types of data node for data modeling
   and describes how these are represented in XML [XML].  For list nodes
   and container nodes, any whitespace, carriage returns, or line feeds
   between the subelements is insignificant, i.e., an implementation MAY
   insert whitespace, carriage return, or line feed characters between
   subelements.

   However for leaf nodes, [RFC7950] section 7.6.6 says

      The value of the leaf node is encoded to XML according to the type
      and is sent as character data in the element.

Wu, et al.              Expires November 30, 2018               [Page 2]
Internet-Draft       YANG Documentation Conventions             May 2018

Show full document text