Subject: Expected behavior when XML is not well formed?

From: "Steven Berl \(sberl\)" <[email-masked]>
Date: Wed, 23 Mar 2005 09:06:03 -0800

- Should a netconf server require messages it receives to contain the XML
declaration (<?xml version="1.0" encoding="UTF-8"?>)? I think the answer is
no. But to quote RFC3470:

   Protocol specifications must be clear about use of XML declarations.
   XML [8] notes that "XML documents should begin with an XML
   declaration which specifies the version of XML being used."  In
   general, an XML declaration should be encouraged ("SHOULD be
   present") and must always be allowed ("MAY be sent").  An XML
   declaration should be required in cases where, if allowed, the
   character encoding is anything other than UTF-8 or UTF-16.

So we probably want to include some text like:
   Netconf messages MAY contain an XML declaration. If it is not present,
the server is to assume that the messages is xml version="1.0" and the
encoding="UTF-8". 
   If the XML declaration is present, it is left to the implementation to
decide if the values of version and encoding are acceptable. If the
implementation chooses to reject the message it should do so by sending an
<rpc-reply> with an <error-tag> value of ??? (INVALID_VALUE?)

- Should a netconf server include the XML declaration in messages that it
sends out? Is it left to the implementation to decide this? I think it is
left to the implemenation, but we probably need to say that explicitly
someplace.
  
What should a netconf server do when it receives an XML message that is not
well formed? Should it send an <rpc-reply> or not? If it does:

- Should it leave out the message-id attribute? 
  Probably yes

- What <error-tag> value should it use? 
  I don't see any particular error code in appendix A that seems to fit this
case of XML that is not well formed. Do we need to add another error to the
list? Do we want to add a generic OTHER_ERROR to the list in appendix B for
things that don't fit cleanly into the defined values?

--
to unsubscribe send a message to [email-masked] with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/netconf/>