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

◆ PushNamespaceImplicit()

void System.Xml.XmlWellFormedWriter.PushNamespaceImplicit ( string prefix,
string ns )
inlineprivate

Definition at line 2550 of file XmlWellFormedWriter.cs.

2551 {
2552 int num = LookupNamespaceIndex(prefix);
2553 NamespaceKind kind;
2554 if (num != -1)
2555 {
2556 if (num > _elemScopeStack[_elemTop].prevNSTop)
2557 {
2558 if (_nsStack[num].namespaceUri != ns)
2559 {
2560 throw new XmlException(System.SR.Xml_RedefinePrefix, new string[3]
2561 {
2562 prefix,
2563 _nsStack[num].namespaceUri,
2564 ns
2565 });
2566 }
2567 return;
2568 }
2569 if (_nsStack[num].kind == NamespaceKind.Special)
2570 {
2571 if (!(prefix == "xml"))
2572 {
2574 }
2575 if (ns != _nsStack[num].namespaceUri)
2576 {
2578 }
2579 kind = NamespaceKind.Implied;
2580 }
2581 else
2582 {
2583 kind = ((!(_nsStack[num].namespaceUri == ns)) ? NamespaceKind.NeedToWrite : NamespaceKind.Implied);
2584 }
2585 }
2586 else
2587 {
2588 if ((ns == "http://www.w3.org/XML/1998/namespace" && prefix != "xml") || (ns == "http://www.w3.org/2000/xmlns/" && prefix != "xmlns"))
2589 {
2591 }
2592 if (_predefinedNamespaces != null)
2593 {
2595 kind = ((!(text == ns)) ? NamespaceKind.NeedToWrite : NamespaceKind.Implied);
2596 }
2597 else
2598 {
2599 kind = NamespaceKind.NeedToWrite;
2600 }
2601 }
2602 AddNamespace(prefix, ns, kind);
2603 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Xml_XmlPrefix
Definition SR.cs:304
static string Xml_RedefinePrefix
Definition SR.cs:328
static string Xml_NamespaceDeclXmlXmlns
Definition SR.cs:308
static string Xml_XmlnsPrefix
Definition SR.cs:306
Definition SR.cs:7
void AddNamespace(string prefix, string ns, NamespaceKind kind)
readonly IXmlNamespaceResolver _predefinedNamespaces
string? LookupNamespace(string prefix)

References System.Xml.XmlWellFormedWriter._elemScopeStack, System.Xml.XmlWellFormedWriter._elemTop, System.Xml.XmlWellFormedWriter._nsStack, System.Xml.XmlWellFormedWriter._predefinedNamespaces, System.Xml.XmlWellFormedWriter.AddNamespace(), System.Xml.ArgumentException, System.Xml.Dictionary, System.SR.Format(), System.Xml.IXmlNamespaceResolver.LookupNamespace(), System.Xml.XmlWellFormedWriter.LookupNamespaceIndex(), System.Xml.XmlWellFormedWriter.Namespace.namespaceUri, System.prefix, System.text, System.SR.Xml_NamespaceDeclXmlXmlns, System.SR.Xml_RedefinePrefix, System.SR.Xml_XmlnsPrefix, System.SR.Xml_XmlPrefix, and System.Xml.XmlException.

Referenced by System.Xml.XmlWellFormedWriter.WriteQualifiedName(), System.Xml.XmlWellFormedWriter.WriteQualifiedNameAsync(), System.Xml.XmlWellFormedWriter.WriteStartAttribute(), System.Xml.XmlWellFormedWriter.WriteStartAttributeAsync_NoAdvanceState(), System.Xml.XmlWellFormedWriter.WriteStartElement(), and System.Xml.XmlWellFormedWriter.WriteStartElementAsync_FinishWrite().