Skip to content

Fix schematron rules silently skipping all checks due to namespace mismatch#4

Merged
DaymareOn merged 2 commits intomainfrom
copilot/investigate-inertia-tag-line-76
May 1, 2026
Merged

Fix schematron rules silently skipping all checks due to namespace mismatch#4
DaymareOn merged 2 commits intomainfrom
copilot/investigate-inertia-tag-line-76

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

The schematron rules in hdtSMP64.sch never fired because their XPath expressions used unprefixed element names, which match elements in no namespace — but valid FSMP config files must declare xmlns="FSMP-Validator" (required by targetNamespace in the XSD), placing all elements in that namespace.

Changes

  • hdtSMP64.sch: Add <sch:ns prefix="f" uri="FSMP-Validator"/> and qualify all XPath expressions with f::
<!-- Before: never matches namespace-qualified elements -->
<sch:rule context="bone[mass = '0']">
    <sch:assert test="not(inertia)" role="error">...</sch:assert>

<!-- After: correctly matches elements in the FSMP-Validator namespace -->
<sch:ns prefix="f" uri="FSMP-Validator"/>
<sch:rule context="f:bone[f:mass = '0']">
    <sch:assert test="not(f:inertia)" role="error">...</sch:assert>

This applies to both f:bone and f:bone-default rules, and all three assert tests (inertia, linearDamping, angularDamping).

Original prompt

Why isn't the inertia tag line 76 raising an error despite the schematron rules?

Created from VS Code.

…o XPath expressions

Agent-Logs-Url: https://github.com/DaymareOn/FSMP-Validator/sessions/54fc6c07-bdf2-4d58-9c3c-dfd2bd14fd44

Co-authored-by: DaymareOn <11396847+DaymareOn@users.noreply.github.com>
@DaymareOn
Copy link
Copy Markdown
Owner

@copilot Ok, continue

Copilot AI changed the title [WIP] Investigate why inertia tag line 76 is not raising an error Fix schematron rules silently skipping all checks due to namespace mismatch Apr 30, 2026
Copilot AI requested a review from DaymareOn April 30, 2026 23:48
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 30, 2026

@copilot Ok, continue

The fix is in commit af333e9.

Root cause: The schematron XPath expressions used unprefixed element names (e.g., bone[mass='0']), which only match elements in no namespace. But FSMP config XML files must declare xmlns="FSMP-Validator" to be valid against the XSD, so all elements live in the FSMP-Validator namespace — meaning the rules never fired.

Fix: Added <sch:ns prefix="f" uri="FSMP-Validator"/> and updated all XPath contexts and assertions to use the f: prefix (e.g., f:bone[f:mass = '0'], not(f:inertia)).

@DaymareOn DaymareOn marked this pull request as ready for review May 1, 2026 00:04
@DaymareOn DaymareOn merged commit d3d00ae into main May 1, 2026
1 check passed
@DaymareOn DaymareOn deleted the copilot/investigate-inertia-tag-line-76 branch May 1, 2026 00:05
@DaymareOn
Copy link
Copy Markdown
Owner

@copilot Ok, it still doesn't raise any error.

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.

2 participants