1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-29 02:40:05 +00:00

Added method XmlElement::isValidXmlName() and implemented standard-compliant checking for XML name validity

This commit is contained in:
jules 2015-10-27 16:50:31 +00:00
parent 7ca51f0a7d
commit 705e7f6110
3 changed files with 65 additions and 22 deletions

View file

@ -1066,7 +1066,12 @@ public:
for (int i = 1 + r.nextInt (numElementsInArray (buffer) - 2); --i >= 0;)
buffer[i] = chars [r.nextInt (sizeof (chars) - 1)];
return CharPointer_ASCII (buffer);
String result (buffer);
if (! XmlElement::isValidXmlName (result))
result = createRandomIdentifier (r);
return result;
}
static String createRandomWideCharString (Random& r)