ImportError: cannot import name 'XmlEncoder'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2021 05:34 PM
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?
- Labels:
-
YANG Development Kit (YDK)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2021 09:45 PM
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.
YDK Solutions
