参考AUTOSAR文档:
arxml只允许使用UTF-8编码,且不允许使用"UTF Byte Order Mask" (BOM)
arxml只允许使用1.0的xml版本,其他版本均不允许
xml信息的声明位于首行:
"1.0" encoding="UTF-8" ...?>
comments信息不影响autosar模型
处理指令亦可忽略
根元素(Element)标签名(tag)为:AUTOSAR,其包含3个属性(Attribute):
xsi:schemaLocation
xmlns
xmlns:xsi
xsi:schemaLocation:所引用schema的位置,如:
xsi:schemaLocation=http://autosar.org/schema/r4.0 AUTOSAR_4-2-1.xsd
xmlns:xml namespace,格式为http://autosar.org/schema/r
xmlns="http://autosar.org/schema/r4.0"
xmlns:xsi:声明当前文件是schema的一个实例,一般固定如下:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
总体上根元素的格式如下:
- <AUTOSAR
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="{AUTOSAR XML Namespace} {Revision Hint URI}"
- xmlns="{AUTOSAR XML Namespace}">
- ...
- </AUTOSAR>
有如下格式:
空元素也需要有首位tag,如:一个空的VALUE应写作