[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: errorInfoContent
> I'm not sure how to write the correct schema, but here's how
> it should work:
>
> - the order and combinations of these elements should not
> be constrained
> - the standard errors specify the minimum content, not the
> only content,
> as this schema fragment might imply.
> - all syntax is QName, except session-id is SessionId (unsignedInt)
> - all maxOccurs should be "unbounded", except session-id is 1.
> - although in general there are no required elements (so
> minOccurs="0"),
> there are specific standard errors that require
> specific elements to
> be present in the error-info field. The schema does
> not reflect
> this,
> but the normative text is clear on the details.
I believe the following snippet meets NETCONF's requirements.
Please take a look. To simplify the XSD a little, session-id must
appear first, if it appears.
<xs:complexType name="errorInfoType">
<xs:sequence>
<xs:element name="session-id" type="SessionId"
minOccurs="0" maxOccurs="1"/>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:sequence>
<xs:element name="bad-attribute" type="xs:QName"
minOccurs="0" maxOccurs="1"/>
<xs:element name="bad-element" type="xs:QName"
minOccurs="0" maxOccurs="1"/>
<xs:element name="ok-element" type="xs:QName"
minOccurs="0" maxOccurs="1"/>
<xs:element name="err-element" type="xs:QName"
minOccurs="0" maxOccurs="1"/>
<xs:element name="noop-element" type="xs:QName"
minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:sequence>
<!-- elements from any other namespace are also allowed to
follow the NETCONF elements -->
<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
There may well be a better way to write this bit of XSD, if some XSD
black belts want to chime in here, please do.
Rob
--
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/>