Skip to content

[svd_parser]: Tags that contain a XML comment are ignored. #228

@pellico

Description

@pellico

svd_parser 0.14.1

If a tag contains a XML comment the tag content is ignored.
see tag licenseText
Below XML has been validated against latest svd.xsd.

How to reproduce:

use svd_parser;


fn main() {

    let xml=r#"<?xml version="1.0" encoding="utf-8"?>
<device schemaVersion="1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="svd.xsd">

	<name>ARM_Example</name>
	<series>ARMCM3</series>
	<version>1.2</version>
	<description>SVD Test for Rust PAC generator</description>
	<licenseText><!-- this license text will appear in header file. \n force line breaks --> Test license\n </licenseText>
	<cpu>
		<!-- details about the cpu embedded in the device -->
		<name>CM3</name>
		<revision>r1p0</revision>
		<endian>little</endian>
		<mpuPresent>true</mpuPresent>
		<fpuPresent>false</fpuPresent>
		<nvicPrioBits>3</nvicPrioBits>
		<vendorSystickConfig>false</vendorSystickConfig>
	</cpu>
	<addressUnitBits>8</addressUnitBits>
	<width>32</width>
	<size>32</size>
	<access>read-write</access>
	<resetValue>0x00000000</resetValue>
	<resetMask>0xFFFFFFFF</resetMask>
	<peripherals>
		<peripheral>
			<name>UART</name>
			<baseAddress>0x50000000</baseAddress>
			<registers>
				<register>
					<name>Reg1</name>
					<addressOffset>0x0</addressOffset>
					<resetMask>0xFFFFFFFF</resetMask>
				</register>
			</registers>
		</peripheral>
	</peripherals>
</device>
    "#;
    let device = svd_parser::parse(xml).unwrap();
    println!("{:?}",device.license_text);
    println!("{:?}",device.description);

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions