XML-Tools - Validation problem
-
Hi,
I’m facing a problem with the validation of xml files against Style Sheets, which occured this year for the first time, while I’m using the same process for several years now. The basic context of what I’m doing is, that I have to report tax information to the German tax offices twice a year and as mentioned before it failed. The error message however is confusing:
The regex behind the according rule is:
[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[1-5][A-Fa-f0-9]{3}-[ABab89][A-Fa-f0-9]{3}-[A-Fa-f0-9]{12}The string that is validated is (as shown):
02c2af01-5d0e-1eef-bdb8-d2d5ad5dd1cbIf I test the regex and the string on a testing website like regex101, it is a valid expression - but in Notepad++ using the path to the XSD in the attribute SchemaLocation, it fails as shown.
Am I wrong or is this a real bug? I’m not sure and help would be appreciated.
Best regards,
Thorsten -
@Thorsten-Kreutz said in XML-Tools - Validation problem:
The regex behind the according rule is:
[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[1-5][A-Fa-f0-9]{3}-[ABab89][A-Fa-f0-9]{3}-[A-Fa-f0-9]{12}The string that is validated is (as shown):
02c2af01-5d0e-1eef-bdb8-d2d5ad5dd1cbIf I copy paste what you posted into Notepad++ then searching for
[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[1-5][A-Fa-f0-9]{3}-[ABab89][A-Fa-f0-9]{3}-[A-Fa-f0-9]{12}
matches02c2af01-5d0e-1eef-bdb8-d2d5ad5dd1cb
as expected.You did not post enough information about the error message itself nor what you are attempting to do with XML Tools that lead up to the error for any of us to replicate the error.
-
@Thorsten-Kreutz said in XML-Tools - Validation problem:
Am I wrong or is this a real bug? I’m not sure and help would be appreciated.
As this is mostly an english “speaking” forum translating your error message would have been helpful to the readers.
So if Google translate is to be believed (it does an amazing job of interpreting my english o, b and a to the german equivalent characters) the message reads:
‘02c2af01-5d0e-1eef-bdb8-d2d5ad5dd1cb’ violates pattern constraint of ‘.*[^ ]’
attribute analysis ‘UUID’ with the value ‘02c2af01-5d0e-1eef-bdb8-d2d5ad5dd1cb’ failedAs @mkupper says and you also alluded to, pasting that string into other sites and testing didn’t produce a reason for the error. So I then looked at the whole error message. The “pattern constraint of ‘.*[^ ]’” is maybe where you need to look instead since we all confirm the actual regex pattern you showed successfully tests the string as provided. When you tested the string did you just copy that into regex101 (from the source) or did you type it out again?
Although it seems stupid to do so, maybe count the length of several of these strings in your XML file. Since your pattern suggests the string should be a fixed length, maybe this string isn’t the same length as the others. It may contain something you/we cannot see.
Terry
-
@Terry-R said in XML-Tools - Validation problem:
It may contain something you/we cannot see.
Yeah, my first thought was that maybe one of the strings contains a non-printing character that’s causing the issue. Turning on the
Show Non-Printing characters
orShow All Characters
setting would reveal whether this is the case.