Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ NonCDataNormalize()

static string System.Xml.XmlComplianceUtil.NonCDataNormalize ( string value)
inlinestatic

Definition at line 7 of file XmlComplianceUtil.cs.

8 {
9 int length = value.Length;
10 if (length <= 0)
11 {
12 return string.Empty;
13 }
14 int num = 0;
16 while (XmlCharType.IsWhiteSpace(value[num]))
17 {
18 num++;
19 if (num == length)
20 {
21 return " ";
22 }
23 }
24 int num2 = num;
25 while (num2 < length)
26 {
27 if (!XmlCharType.IsWhiteSpace(value[num2]))
28 {
29 num2++;
30 continue;
31 }
32 int i;
33 for (i = num2 + 1; i < length && XmlCharType.IsWhiteSpace(value[i]); i++)
34 {
35 }
36 if (i == length)
37 {
38 if (stringBuilder == null)
39 {
40 return value.Substring(num, num2 - num);
41 }
42 stringBuilder.Append(value, num, num2 - num);
43 return stringBuilder.ToString();
44 }
45 if (i > num2 + 1 || value[num2] != ' ')
46 {
47 if (stringBuilder == null)
48 {
50 }
51 stringBuilder.Append(value, num, num2 - num);
52 stringBuilder.Append(' ');
53 num = i;
54 num2 = i;
55 }
56 else
57 {
58 num2++;
59 }
60 }
61 if (stringBuilder != null)
62 {
63 if (num < num2)
64 {
65 stringBuilder.Append(value, num, num2 - num);
66 }
67 return stringBuilder.ToString();
68 }
69 if (num > 0)
70 {
71 return value.Substring(num, length - num);
72 }
73 return value;
74 }

References System.Xml.Dictionary, System.Xml.XmlCharType.IsWhiteSpace(), System.length, and System.value.

Referenced by System.Xml.Schema.FacetsChecker.CheckWhitespaceFacets(), System.Xml.Schema.XsdBuilder.ParseQName(), System.Xml.Schema.Datatype_anySimpleType.TryParseValue(), System.Xml.Schema.Preprocessor.ValidateNameAttribute(), and System.Xml.Schema.SchemaCollectionPreprocessor.ValidateNameAttribute().