-
Notifications
You must be signed in to change notification settings - Fork 464
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
WFCORE-6812 Allow validating multiple XML files #6051
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me, but what this PR does is create a new method to load multiple XML files as a single one.
The Jira description does not clarify too much, at least to me, about what is the final goal here. Is it to allow the validation of multiple XML files against a common XSD schema? Notice this class is used for subsystems, so I would understand the intention here is to concatenate multiple XML subsystem files into a single one, and if that's the intention, the final one will have multiple xmls namespaces, so, I don't get how this is expected to work.
@parsharma / @michpetrov Could you describe the Jira intention better and how this method would allow validating multiple XML files?
My only bet is that this is here to allow later to do the following:
SchemaValidator.validateXML(getSubsystemXml(List<String>), schemaPath, getResolvedProperties());
And, if that's the case, exposing a method that does this validation is the task to do here, otherwise this PR is to allow composing multiple XML files in a single one. And also, I cannot figure out what list of XML would be passed to this method, to do the above the resulting XML file should only have a single XML NS ... correct me if I am wrong, I think I need to refresh my XML knowledge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work unfortunately, if you concatenate multiple files it's no longer a valid XML and the parser will fail. Bear in mind that getSubsystemXml()
is used in other methods, so we can't change its output.
I don't think you can get around processing the contents of each file separately.
@yersan The goal is to validate multiple files against a single schema, yes. I'm assuming the expected usage was to do
which is kinda what I had in mind in terms of what's required to do in a given subsystem test. But putting it all into a single file doesn't work for the parser. |
thanks @michpetrov, then do you think we should close the Jira as won't do? Otherwise, I would need a real use case since I don't know yet what kind of subsystem XML files we would need to compose and validate against a single xsd schema. I am also reluctant to add any piece of code if it is not going to be used yet, adding something for the future for someone who would need it doesn't look good, better let's add it when there is an immediate usage need. |
@yersan there are subsystems like datasources that use multiple files for testing - https://github.com/wildfly/wildfly/tree/main/connector/src/test/resources/org/jboss/as/connector/subsystems/datasources currently only |
There has been no activity on this PR for 45 days. It will be auto-closed after 90 days. |
Issue: https://issues.redhat.com/browse/WFCORE-6812