RFE: Expose functions to validate NameStartChar and NameChar
xmlIsDocNameStartChar()
or xmlIsNameStartChar()
(and their NameChar()
counterparts) provide exactly what I need for code that I'm writing, but they're not part of the public API.
I'm aware of xmlValidateNameValue()
. However, I need to validate the individual characters. We auto-generate XML IDs based on other strings that may not match the Name
production. Sometimes we have to sanitize the strings by replacing start characters that don't match the NameStartChar
production or later characters that don't match NameChar
.
FWIW my project won't be able to use any new feature for a while, as we can only rarely update the minimum required libxml2 version. For now I'll be copying the functions into our code.