[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RELAX NG Schema for NETCONF



Hello,

I'm sorry that this is not "true" reply but I subscribed now and can use only messages from web archive.

Here is a RELAX NG schema for the NETCONF protocol.
It's not any shorter than the XSD that appears in the draft,
but it's somewhat easier to understand at first glance (imho).

The protocol examples in the -04 draft have all been validated against this schema.

I was testing this Relax NG scheme and it looks ok. I propose few improvements because I think that next changes better cover ietf netconf draft. Please, let me know if I am wrong.

Add <config> element to config type.

<define name="config">
+ <element name="config">
   <zeroOrMore>
     <ref name="anyElement"/>
   </zeroOrMore>
+ </element>
</define>

Therefore next example looks like valid (which obviously is not):

<rpc message-id="4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
 <edit-config>
   <target>
     <running/>
   </target>
   <xxx/>
 </edit-config>
</rpc>

----

This is missing in xsd schema as well:

<define name="error-option">
 <element name="error-option">
   <choice>
+     <value>rollback-on-error</value>
     <value>stop-on-error</value>
     <value>ignore-error</value>
   </choice>
 </element>
</define>

----

And previously discussed multiple errors:

<define name="rpcReplyType">
 <choice>
   <element name="ok">
     <empty/>
   </element>
+   <oneOrMore>
     <ref name="rpcErrorType"/>
+   </oneOrMore>
   <element name="data">
     <optional>
       <ref name="anyElement"/>
     </optional>
   </element>
 </choice>
</define>

----

And I have one question.
Is this example correct? It is in draft (rollback-on-error capability), but neither xsd schema nor Relax NG can't validate it (due to bad order).

      <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
        <edit-config>
          <error-option>rollback-on-error</error-option>
          <target>
            <running/>
          </target>
          <config>
            <top xmlns="http://example.com/schema/1.2/config";>
              <interface>
                <name>Ethernet0/0</name>
                <mtu>100000</mtu>
              </interface>
            </top>
          </config>
        </edit-config>
      </rpc>

It is supposed to be interleaved or it is mistake in draft?

Thanks.

--
Bc. Ondrej Zlosky
xzlosky@fi.muni.cz
xzlosky@liberouter.org
www.liberouter.org/netopeer/


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