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

The information below is for an old version of the document
Document Type Active Internet-Draft (individual)
Last updated 2018-01-26
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: July 30, 2018                                  Juniper Networks
                                                               B. Claise
                                                     Cisco Systems, Inc.
                                                        January 26, 2018

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

Abstract

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

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

   This document lays out documentation conventions that allow YANG
   examples to be presented in IETF documentation when leaf node
   encoding would otherwise exceed the maximum line length.  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 July 30, 2018.

Wu, et al.                Expires July 30, 2018                 [Page 1]
Internet-Draft       YANG Documentation Conventions         January 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.  Separating Components of a Leaf Example . . . . . . . . . . .   3
   4.  Splitting an Example Leaf Node Value Across Lines . . . . . .   4
   5.  Mandatory Boilerplate Text  . . . . . . . . . . . . . . . . .   5
   6.  Representing XML Encodings of Metadata Annotations  . . . . .   6
   7.  Mandatory Boilerplate for Splitting Metadata Annotations  . .   6
   8.  Automatic Generation of Valid XML From Examples . . . . . . .   7
   9.  Security Considerations . . . . . . . . . . . . . . . . . . .   7
   10. IANA Considerations . . . . . . . . . . . . . . . . . . . . .   8
   11. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .   8
   12. Normative References  . . . . . . . . . . . . . . . . . . . .   8
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .   8

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.

   Thus whitespace, carriage return, and line feed characters are
   interpreted as part of the leaf value if the leaf is of type string
   and must not be included.  The same applies to leaf-list nodes.

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

   However, when documenting examples of YANG modules represented in XML
   encoding it is possible that the encoding of a single leaf node will
   exceed the available line length (73 characters).
Show full document text