config_tools: handle multiple xs:documentation properly
With multiple xs:documentation nodes under the same xs:annotation, xs2js will convert the XML into a dict where the key `xs:documentation` maps to a list rather than a string. This patch enhances the converter.py to handle such case properly. Tracked-On: #8098 Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
parent
ad960a7ca1
commit
14fe92a82f
|
@ -346,7 +346,9 @@ class XS2JS:
|
|||
js_ele['title'] = annotation.get('@acrn:title', name)
|
||||
|
||||
# documentation
|
||||
documentation: str = annotation.get('xs:documentation', None)
|
||||
documentation = annotation.get('xs:documentation', None)
|
||||
if isinstance(documentation, list):
|
||||
documentation = documentation[0]
|
||||
if documentation is None or documentation.strip() == '':
|
||||
documentation = ''
|
||||
if documentation:
|
||||
|
|
Loading…
Reference in New Issue