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

◆ RemapPrefix()

string System.Xml.Xsl.Runtime.XmlQueryOutput.RemapPrefix ( string prefix,
string ns,
bool isElemPrefix )
inlineprivate

Definition at line 897 of file XmlQueryOutput.cs.

898 {
899 if (_conflictPrefixes == null)
900 {
902 }
903 if (_nsmgr == null)
904 {
905 _nsmgr = new XmlNamespaceManager(_runtime.NameTable);
907 }
908 string value = _nsmgr.LookupPrefix(ns);
909 if ((value == null || (!isElemPrefix && value.Length == 0)) && (!_conflictPrefixes.TryGetValue(ns, out value) || !(value != prefix) || (!isElemPrefix && value.Length == 0)))
910 {
911 value = "xp_" + _prefixIndex++.ToString(CultureInfo.InvariantCulture);
912 }
914 return value;
915 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
static CultureInfo InvariantCulture
virtual ? string LookupPrefix(string uri)
readonly XmlQueryRuntime _runtime
Dictionary< string, string > _conflictPrefixes

References System.Xml.Xsl.Runtime.XmlQueryOutput._conflictPrefixes, System.Xml.Xsl.Runtime.XmlQueryOutput._nsmgr, System.Xml.Xsl.Runtime.XmlQueryOutput._prefixIndex, System.Xml.Xsl.Runtime.XmlQueryOutput._runtime, System.Globalization.CultureInfo.InvariantCulture, System.Xml.XmlNamespaceManager.LookupPrefix(), System.Xml.Xsl.Runtime.XmlQueryRuntime.NameTable, System.prefix, System.Xml.XmlNamespaceManager.PushScope(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.

Referenced by System.Xml.Xsl.Runtime.XmlQueryOutput.CheckAttributePrefix(), System.Xml.Xsl.Runtime.XmlQueryOutput.EnsureValidName(), and System.Xml.Xsl.Runtime.XmlQueryOutput.WriteStartComputed().