Subject: [Netconf] 2 more netconf-monitoring-03 comments

From: Andy Bierman <[email-masked]>
Date: Fri, 27 Feb 2009 12:08:35 -0800

Hi,

12) The example on pg 10 shows the schema being returned
     in a CDATA section.  I don't think this is needed,
     because the <data> element as type 'any'.  Whatever
     format is inserted will be valid XML (although YANG
     files will have some chars converted to character entities).
     Inserting a valid XSD should be OK without CDATA, right?

13) The key-stmt for the schema list in the YANG module
     seems to be in the wrong order.  The leaf order matches
     the XSD (identifier, version, format) but the key
     is ordered "identifier format version"?  This is a bug,
     right?  The key order should match the leaf order.

Andy

---

From: WashamFan <[email-masked]>
Date: Sat, 28 Feb 2009 10:16:54 +0800

>       Inserting a valid XSD should be OK without CDATA, right?

To my knowledge, CDATA is used to prevent text containing 
too many illegal chars (e.g. '<','&') from getting parsed.
a Valid XSD contains too many '<', right? Of course, you can
convert all of them into "&lt;", but CDATA is a simpler way.
Note that, A CDATA section cannot contain the string "]]>",
what if the XSD contains "]]>"? CDATA should not be used
in this case.
IMHO, CDATA can be freely used but not mandatory to be
used and should not be used when the XSD contains "]]>".

washam

---

From: Martin Bjorklund <[email-masked]>
Date: Sat, 28 Feb 2009 12:59:22 +0100 (CET)

>      Inserting a valid XSD should be OK without CDATA, right?

Yes you're right.  The CDATA should be removed.
 
>      right?  The key order should match the leaf order.

Yes.

/martin

---

From: Martin Bjorklund <[email-masked]>
Date: Sat, 28 Feb 2009 13:41:33 +0100 (CET)

> too many illegal chars (e.g. '<','&') from getting parsed.

Yes, so CDATA would have been used if the type was "xs:string", but
in this case the type is "xs:anyType", which means that any valid XML
is accepted.  An XSD is of course valid XML.

BTW, it's not *wrong* to have the CDATA there, but it changes the
content of the <data> element - with the CDATA the content is a
string, w/o it the content is an XML element.

Hmm.  Maybe we should not re-use the 'data' element, but instead use
our own element which is a string?  By using xs:anyType, a client must
be prepared to handle this reply:

     <rpc-reply message-id="101"
                xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <data xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <![CDATA[
       <xs:schema targetNamespace="urn:ietf:params:xml:ns:netconf:state">
         <!-- Contents of foo schema would be returned here -->
       </xs:schema>]]>
     </data>
   </rpc-reply>

I.e. the "xs" prefix is declared on the "data", so the client cannot
just extract the content of "data" and store it as an XSD file.

/martin