> On 09 Jun 2015, at 22:23, Martin Bjorklund <[email protected]> wrote:
> 
> Ladislav Lhotka <[email protected]> wrote:
>> Hi,
>> 
>> RFC 6020bis says in Sec. 7.10: The "anydata" statement is used to
>> represent an unknown set of nodes that can be modelled with YANG." I'd
>> like to clarify what this means with respect to namespaces.
>> 
>> 1. Is it allowed that the XML content (value) of an anydata node have no
>>   namespace? That is:
>> 
>>   anydata foo;
>> 
>>   <foo>
>>     <bar xmlns=""/>
>>   </foo>
>> 
>>   I assume it is not allowed.
> 
> Right, b/c this cannot be encoded with the encoding rules for anydata,
> which says that the element's namespace is the module's XML namespace
> (and this cannot be "").
> 
>> 2. For a namespace URI that's used for anydata content, is it required
>>   that there exist a YANG module defining this URI as its namespace?
>> 
>>   I assume it is not required.
> 
> Yes.
> 
> I don't see how it could be enforced?  How can you tell if a YANG
> module exists?

For example, it could be required that the server advertises such a module so 
as to be known at run time. I am not proposing this, just verifying that 
everybody interprets “can be modelled” the same way.

It is also important for the JSON encoding - it means there won’t necessarily 
be a way for mapping XML-encoded instance to JSON and vice versa.

Lada

> 
> I do want to be able to have a generic model like:
> 
>   list logged-notification {
>     ...
>     anydata notif;
>   }
> 
> and implement this in a server that doesn't necessarily know the data
> model of every possible notification.
> 
> 
> /martin

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C




_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to