12 private readonly StringBuilder output =
new StringBuilder();
13 private readonly Dictionary<string, string> namespceByPrefix =
new Dictionary<string, string>();
30 this.output.Append(s);
39 this.output.Append(ch);
48 return this.output.ToString();
59 if (this.namespceByPrefix.TryGetValue(Prefix, out
string PrevNamespace))
61 if (PrevNamespace == Namespace)
67 if (this.newPrefixes is
null)
70 this.newPrefixes.
Add(
new KeyValuePair<string, string>(Prefix, PrevNamespace));
71 this.namespceByPrefix[Prefix] = Namespace;
81 this.prefixStack.Add(this.newPrefixes);
82 this.newPrefixes =
null;
90 if (!this.prefixStack.HasLastItem)
95 if (!(ToRemove is
null))
97 foreach (KeyValuePair<string, string> P
in ToRemove)
100 this.namespceByPrefix.Remove(P.Key);
102 this.namespceByPrefix[P.Key] = P.Value;
Current state of XML normalization process.
void PushPrefixes()
Pushes current prefix state to the stack.
bool RegisterPrefix(string Prefix, string Namespace)
Registers prefix for element.
XmlNormalizationState()
Current state of XML normalization process.
void Append(char ch)
Appends a character to the output.
override string ToString()
XML output.
void PopPrefixes()
Pops previous prefix state from the stack.
void Append(string s)
Appends a string to the output.
A chunked list is a linked list of chunks of objects of type T .
T RemoveLast()
Removes the last item in the collection.
void Add(T Item)
Adds an item to the collection.