cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
515
Views
5
Helpful
1
Replies

ImportError: cannot import name 'XmlEncoder'

shreyash
Cisco Employee
Cisco Employee

I have following installed in my virtual env

 

ydk                             0.8.5.post2

ydk-models-cisco-ios-xr         7.5.1       

ydk-models-cisco-thinxr-install 6.5.1       

ydk-models-ietf                 0.1.5.post2

ydk-models-openconfig           0.1.6.post1

ydk-service-gnmi                0.4.0.post5

 

```

from ydk.providers.codec_provider import XmlEncoder

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ImportError: cannot import name 'XmlEncoder'
```

Is XmlEncoder not a part of ydk package anymore now?

 

1 Reply 1

yangorelik
Spotlight
Spotlight

Hi Shreyash

There is no such class in the YDK as XmlEncoder. Not sure where did you get such info, please share with me. For conversion from Entity child to XML there are multiple tools:

1. The simplest one is XmlSubtreeCodec. Please check documentation on how to use it.

2. More comprehensive is CodecService with CodecServiceProvider. You can find multiple examples on how to use it here.

Yan Gorelik
YDK Solutions
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: