xml-lint icon indicating copy to clipboard operation
xml-lint copied to clipboard

Feature Request: Support for URN mappings for XML Schema

Open dfelton opened this issue 3 years ago • 2 comments

Scenario:

If the XML Schema defined in a file utilizes an URN value as opposed to a path or URL, validation against the schema currently fails. Reviewing the output of --help, as well as this repository's README.md, it does not appear there is any ability to specify a map value for URNs. This leaves us to be forced to pass -s and never perform XSD validation despite having an XML Schema to validate against.

Feature Request:

Support for URN mappings to specify the location of an XSD file when a given URN value is encountered.

Misc Note: It would be nice if this feature were introduced by implementing support for some sort of .xml-lint.xml configuration file (as a default value), or option to specify a configuration file in the command. This XML file could then contain multiple mappings in the event that a directory of XML files contains files that follow more than one XSD. As opposed to having to always know the URN value of an XML file prior to validation, and always having to then pass the appropriate path/url to the XSD for each and every file.

Final Thoughts:

The "misc note" above could in turn be expanded upon in future new features, so that users can configure their entire test suite (all files / directories to be scanned, files / directories to be ignored, etc). Doing so would then simplify CI efforts if someone wants to implement this XML linter into their automated code quality checks.

dfelton avatar Aug 25 '22 21:08 dfelton

Hi @dfelton ,

this is a great request. I ran into the same issue already in the past, but retreated to -s and didn't think of a missing feature.

Unfortunately my time is very limited at the moment, as you might have already guessed by looking at the response time. Sorry for that.

I'm always happy for PRs, otherwise I'll pick it up as soon as I can :)

br

m-bymike avatar Sep 12 '22 05:09 m-bymike

Unfortunately my time is very limited at the moment, as you might have already guessed by looking at the response time. Sorry for that.

As a father of a 3 and 1 year old I absolutely understand haha

I'm always happy for PRs, otherwise I'll pick it up as soon as I can :)

I'll see what I can do, as you can probably suspect from my prior comment, "as soon as I can" can be a rather vague timeline here too.

dfelton avatar Sep 12 '22 12:09 dfelton