Skip to content

Conversation

@stephane-pv
Copy link
Collaborator

@stephane-pv stephane-pv commented Sep 18, 2025

This pull request is intended to add more automated validation for .pv2 files.

The idea is to keep the XSD 1.0 validation that comes built in with the schema, but to also enforce more complex rules like:

  • All "standard" PVCollada tags should appear in a technique tag with profile='PVCollada-2.0'
  • Making sure that PVCollada elements are located under the "right" parent element (project can only appear in COLLADA/asset/extra/technique, terrain can only appear in geometry/extra/technique, etc)
  • No duplicates are allowed within the same "scope" (we cannot have 2 technique tags with profile='PVCollada-2.0' under the same parent, we cannot have 2 project tags, we cannot have terrain and rack tags under the same geometry, etc)
  • Making sure that a PVCollada instance_post tag is under an instance_geometry tag that correctly references (through #url) a Collada geometry tag that has PVCollada post tag
  • Making sure that the parent node of a table contains at least one instance_geometry child with a rack tag
  • Making some tags required/forbidden depending on others tags values (for example in rack we want to have tilt and azimuth required for fixed_tilt while tracker_azimuth would be required for tracker)

A first attempt will be made with SchemaTron and a python validation script will be provided for easily validating any file against the XSD file and the SchemaTron file.

The automatic validation workflow will also be modified to validate all example files against the XSD file and the SchemTron file

Added documentation for elements whose location was not specified
- Created a schematron file for validation of the basic structure of the document (making sure PVCollada elements are located in the "right" parent element, no duplicates allowed, etc)
- Updated the validation workflow to also validate the example files against the schematron file on top of the XSD file
- Updated the validation script located in the schema folder to validate files against the XSD and the schematron files
- Added instance_gap to schema
- Made small adjustments to the schema documentation
@cwhanse
Copy link
Member

cwhanse commented Sep 18, 2025

@stephane-pv I like where this is going. Do you think that the schematron validation is better as a separate github action?

Added a new schematron file to validate references between PVCollada objects (for example making sure that the module_id used in the rack tag contains the id of an existing module defined in components/modulesc)
A table must have at least one rack
Added a new schematron file to validate business rules (for example making azimuth/tilt/tracker_azimuth fields required/forbidden in rack depending on rack type)
- Added cable3d to schema
- Added instance_cable3d to schema
- Added corresponding schema tron validation
XSD validation and schematron validations are now performed in different steps (1 step for XSD and 1 step for each schematron file)
@stephane-pv
Copy link
Collaborator Author

@stephane-pv I like where this is going. Do you think that the schematron validation is better as a separate github action?

I have added steps so that each validation (XSD and schematron) is performed in a separate step. This way we can clearly see which one failed.

@stephane-pv stephane-pv marked this pull request as ready for review September 19, 2025 14:07
@stephane-pv stephane-pv requested a review from cwhanse September 19, 2025 14:07
@cwhanse cwhanse merged commit 25bef97 into main Sep 19, 2025
12 checks passed
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