フィルターのクリア

Need help regarding extract information from (AUTOSAR) XML file!

24 ビュー (過去 30 日間)
Saeed Soltani
Saeed Soltani 2016 年 6 月 28 日
回答済み: Deepika Mani 2019 年 3 月 7 日
Hi, I have to read an AUTOSAR system description file (.arxm) in MATLAB and extract all the port connections of Software Components (SWCs). As far as I could find no such possibility in arxml.importer class, I thought may be using XML reader would be the only solution. However I do not know how exactly! Or maybe the pre-written XML tools by users would be useful in this case? It would be great if anybody can share his/her idea or solution. Thank you in advance.
  1 件のコメント
James Marriott
James Marriott 2018 年 6 月 20 日
Did you manage to achieve this? I am trying to achieve the same.

サインインしてコメントする。

回答 (1 件)

Deepika Mani
Deepika Mani 2019 年 3 月 7 日
Hi,
Extraction of data from arxml file is feasible through xml reader. Below is a code snippet to extract port names from the arxml file:
DOMnode = xmlread(xmlfile);
port_node = DOMnode.getElementsByTagName('PORTS');
name_node = port_node.item(0).getElementsByTagName('SHORT-NAME');
for n=0:name_node.getLength-1
port_name = name_node.item(n).getTextContent;
disp(port_name);
end
This can be extended to extract any value from the arxml file.
I hope this solves your need!

カテゴリ

Help Center および File ExchangeAUTOSAR Blockset についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by