03-29-2019 06:02 AM
Is there any way to indent an arxml file without importing autosar module through python language.Thanks in advance...
04-01-2019 01:11 PM
*.arxml as I undersatnd is XML but with an AUTOSAR specific schema. So you should be able to do the same manipulation as you would with any XML parser/editor.
For python specifically it looks like ElementTree is the standard solution for XML,
https://docs.python.org/3/library/xml.etree.elementtree.html#module-xml.etree.ElementTree
04-09-2020 11:58 PM
Try ElementTree.
First build an Element instance root
from the XML, e.g. with the XML function, or by parsing a file with something like:
import xml.etree.ElementTree as ET
root = ET.parse('thefile.xml').getroot()
Or any of the many other ways shown at ElementTree
. Then do something like:
for type_tag in root.findall('bar/type'):
value = type_tag.get('foobar')
print(value)
And similar, usually pretty simple, code patterns.
04-10-2020 10:30 AM
Hi Ankit@1,
What do you mean by indenting? What do you need to with the ARMXL file, eg read from or write to it?
Thanks,
Frank