Case-insensitive XSD attribute validation?

In my custom language plugin I've registered an xml.fileNSInfoProvider implementation that returns a set of XSDs for my plugin's composite markup.  This provides both attribute completion and validation in the resulting documents.  However, I do have one issue and wanted to ask about options to resolve it.  The runtime environment for this particular markup is case-insensitive whereas XSD is inherently case-sensitive.  This means that existing files which use, for example, onclick instead of onClick are marked as invalid even though they're technically valid in the runtime environment.  I'm not as concerned about case-insensitivity during completion, but I'm hoping there's some way I can tell IDEA to validate against the XSDs in a case-insensitive manner.  Is that possible?

Aside from ditching the XSD-based approach which would be a non-trivial amount of rework, the only option that comes to mind is to augment the XSDs with the most common case variants of these attributes, e.g., onclick, onClick, OnClick, and ONCLICK.  I would think that any other variations would likely be unintentional anyway.  The downside of this approach is of coruse that it "pollutes" the XSD unnecessarily, and of course during completion it would appear that there are additional attributes available even after an attribute has been used because of the multiple variants.

Thanks in advance for any thoughts!

0
1 comment

Never mind.  I figured out how to do this by using a custom XmlElementDescriptorProvider that returns XmlElementDescriptors which use case-insensitive matching to respond to getAttributeDescriptor().

0

Please sign in to leave a comment.