Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSD Validate - name attributes must not have whitespace #652

Merged
merged 1 commit into from
May 16, 2022

Conversation

hamishwillee
Copy link
Contributor

Name attributes must not contain whitespace - that's required because they are used as ids for generated items.

This adds XSD validation to ensure that only word characters are used in name attributes or the _ character.

Note that the pattern check of "\w+" should have been fine because my understanding is that in normal RE this includes the underscore. However running the validator failed on underscores so I was forced to explicitly support them: "[\w_]+"

@peterbarker This follows on from mavlink/mavlink#1824.

Note:

  • leading and trailing whitespace would actually be OK, because you could reasonably strip this in the parser. This does not allow it though, and it is never "needed".
  • I think the parser should also strip leading/trailing spaces.
  • running this on all.xml spots two more fails in AVSSUAS.xml : MODE_M300_HOTPOINT_MODE and MODE_M300_NAVI_SDK_CTRL

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@hamishwillee
Copy link
Contributor Author

Great, feel free to merge too - I don't have rights here :-)

@hamishwillee
Copy link
Contributor Author

Fixed the broken enums in AVSSUAS in mavlink/mavlink@20626df

@tridge tridge merged commit 7a4a300 into ArduPilot:master May 16, 2022
@hamishwillee hamishwillee deleted the validate_name branch May 18, 2022 08:08
@hamishwillee
Copy link
Contributor Author

Thanks very much for merging.

@peterbarker
Copy link
Contributor

peterbarker commented Oct 11, 2022 via email

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.

3 participants