Feature: advanced xml validation#1146
Open
vivoeiva wants to merge 11 commits into
Open
Conversation
When generic=true, oneNodeGroup uses xs:any processContents="lax" instead of a closed xs:choice, allowing unknown custom node elements to pass validation. Top-level xs:element declarations are also emitted so that lax processing can still resolve and validate the known built-in node types by name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generates the generic XSD schema from the default factory (built-in nodes only) and prints it to stdout, suitable for use as a generic static validator that stays in sync with the built-in node inventory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PortsList is an unordered_map so iterating it directly produced XSD attributes in hash-table order, which varies across runs and platforms. Sort ports into a std::map before emitting xs:attribute elements. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
XSD alone cannot express constraints like "every custom node element used in a BehaviorTree body must have a matching TreeNodesModel entry" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generates an ISO Schematron schema (btcpp4.sch) complementing the generic XSD Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
I'd like to give also some context on results: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was looking into different BT.CPP xml file examples (at least they look so at the first glance) and found out that some of them are actually not completely valid. Moreover, trying to open them in Groot2 brings it to an endless loop. Sadly there is no obvious way to validate these files, so I'd like to introduce one.
In general, the following functionality is added:
It also seems that not all xml files in the repository (these that should be valid) pass the validation. I would address it in a different PR if needed.
NB: LLM (Claude) was used to improve and contribute to the code where my knowledge is limited (Schematron in particular). All LLM contributions have been reviewed by me.