Skip to content

Make the launch element choice a group to enable extensibility#7

Open
thettasch-samxl wants to merge 1 commit into
nobleo:mainfrom
sam-xl:feat/launch-elements-as-group
Open

Make the launch element choice a group to enable extensibility#7
thettasch-samxl wants to merge 1 commit into
nobleo:mainfrom
sam-xl:feat/launch-elements-as-group

Conversation

@thettasch-samxl

Copy link
Copy Markdown

First off, thank you for creating the schema! Its been hugely useful in creating/validating launch files.

When using ros2 launch with extensions (e.g. custom ros2 launch actions, example), it would be nice to somehow extend the schema to include the additionally defined elements. Currently, this is difficult/impossible to acheive (at least with XSD 1.0) without copying the whole schema and then making changes.

This PR suggests a change that allows for extension of this schema, for example by creating the following extended_schema.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:redefine schemaLocation="ros2_launch.xsd">
        <xsd:group name="launchElements">
            <xsd:choice>
                <xsd:group ref="launchElements" />
                <xsd:element ref="my_custom_element" />
            </xsd:choice>
        </xsd:group>
    </xsd:redefine>

    <!-- Custom element -->
    <xsd:element name="my_custom_element">
        <xsd:complexType> 
            <xsd:attribute name="name" type="substitution_string" />
        </xsd:complexType>
    </xsd:element>

</xsd:schema>

The change is backwards compatible, so using just ros2_launch.xsd should work the same as it did before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant