A problem about anyxml of cost


xinwang
 

Hi Xiao,

I have a problem when i tried to set cost value of dst-costs by using yang-generated-code. I found there is no method (looks like setCost(value)) and field for setting it. Maybe it’s because the type of cost is defined as anyxml, and yang-tools just ignore it. Did you also met this problem? And if you met how did you handle it?

Thanks,
Xin

发自 Windows 邮件


Xiao SHI <xiao.shi@...>
 

Hi Xin,

By "anyxml" in the YANG Model, the content of the xml data file can by arbitrary. If there is no necessity in using the anyxml statement, I would try to avoid it as much as possible and actually model the data. If it is strictly necessary, then you might need to parse that part of the xml file on your own.

Best,
Xiao

On Mon, Apr 13, 2015 at 10:17 AM, wangxin <xinwang2014@...> wrote:
Hi Xiao,

I have a problem when i tried to set cost value of dst-costs by using yang-generated-code. I found there is no method (looks like setCost(value)) and field for setting it. Maybe it’s because the type of cost is defined as anyxml, and yang-tools just ignore it. Did you also met this problem? And if you met how did you handle it?

Thanks,
Xin

发自 Windows 邮件



xinwang
 

Thanks for your suggestion, i have been told that DOM APIs support it now and i am looking into it. But i think currently modify the data would be the easiest way. If we choose to use DOM data and DOM broker, there are a lot of works to do. Considering this is the first version of alto in odl, i prefer your suggestion that just avoid it. And in future i will try to change to DOM if it’s suitable. How does this sound?

Thanks,
Xin

发自 Windows 邮件

发件人: xiao.shi@...
发送时间: ‎2015‎年‎4‎月‎14‎日, ‎星期二 ‎5‎:‎48
收件人: xin wang
抄送: xiao.shi@..., alto-dev@...

Hi Xin,

By "anyxml" in the YANG Model, the content of the xml data file can by arbitrary. If there is no necessity in using the anyxml statement, I would try to avoid it as much as possible and actually model the data. If it is strictly necessary, then you might need to parse that part of the xml file on your own.

Best,
Xiao

On Mon, Apr 13, 2015 at 10:17 AM, wangxin <xinwang2014@...> wrote:
Hi Xiao,

I have a problem when i tried to set cost value of dst-costs by using yang-generated-code. I found there is no method (looks like setCost(value)) and field for setting it. Maybe it’s because the type of cost is defined as anyxml, and yang-tools just ignore it. Did you also met this problem? And if you met how did you handle it?

Thanks,
Xin

发自 Windows 邮件