Ladislav Lhotka <[email protected]> wrote: > > > On 23 May 2016, at 15:43, Martin Bjorklund <[email protected]> wrote: > > > > > >> - section 3.1 > >> > >> There is an overall question regarding whitespace in XML in > >> "non-significant" places. Is it allowed in the XML representation of > >> data trees? And if so, precisely what whitespace is allowed? Also, > >> to what degree is the whitespace shown in examples what is allowed on > >> the wire, and to what degree is it there just to make the example > >> easier to read? (It's possible that XML has implemented some sort of > >> global solution for the issue of non-significant whitespace, but back > >> when I was using it regularly, there was none.) > > > > Good catch! Interesting that noone has found this before! > > This follows from the fact that YANG doesn't support mixed content:
No; we could have said that the encoding doesn't allow any data between elements. > there is no way how this whitespace can be made significant. > > > > > I think we need to say that whitespace is insignificant between > > elements. So I propose to add a paragraph to the end of 7.5.7 > > (container XML encoding rules): > > > > NEW: > > > > Any whitespace between the subelements to the container is > > insignificant, i.e., an implementation MAY insert whitespace > > characters between subelements. > > > > and insert a fourth paragraph in 7.8.5 (list XML encoding rules): > > > > NEW: > > > > Any whitespace between the subelements to the list entry is > > insignificant, i.e., an implementation MAY insert whitespace > > characters between subelements. > > I think this clarification would be useful, but maybe it should be > stated separately (not in container/list sections) because it also > applies to whitespace at the top level of a document. But that should be stated in the protocol spec. YANG doesn't control the top-level of those documents. > It could also > say that other character data or CDATA sections are not > permitted. What about comments and processing instructions? I don't think we have to say anything about them; they are handled generically by the XML spec. For example: Comments may appear anywhere in a document outside other markup; in addition, they may appear within the document type declaration at places allowed by the grammar. They are not part of the document's character data /martin _______________________________________________ netmod mailing list [email protected] https://www.ietf.org/mailman/listinfo/netmod
