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

◆ AddXmlnsAttribute()

XmlAttributeNode System.Xml.XmlBaseReader.AddXmlnsAttribute ( Namespace ns)
inlineprotectedinherited

Definition at line 1567 of file XmlBaseReader.cs.

1568 {
1569 if (!ns.Prefix.IsEmpty && ns.Uri.IsEmpty)
1570 {
1571 XmlExceptionHelper.ThrowEmptyNamespace(this);
1572 }
1573 if (ns.Prefix.IsXml && ns.Uri != "http://www.w3.org/XML/1998/namespace")
1574 {
1575 XmlExceptionHelper.ThrowXmlException(this, new XmlException(System.SR.Format(System.SR.XmlSpecificBindingPrefix, "xml", "http://www.w3.org/XML/1998/namespace")));
1576 }
1577 else if (ns.Prefix.IsXmlns && ns.Uri != "http://www.w3.org/2000/xmlns/")
1578 {
1579 XmlExceptionHelper.ThrowXmlException(this, new XmlException(System.SR.Format(System.SR.XmlSpecificBindingPrefix, "xmlns", "http://www.w3.org/2000/xmlns/")));
1580 }
1581 _nsMgr.Register(ns);
1582 XmlAttributeNode xmlAttributeNode = AddAttribute(QNameType.Xmlns, isAtomicValue: false);
1585 return xmlAttributeNode;
1586 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlSpecificBindingPrefix
Definition SR.cs:496
Definition SR.cs:7
readonly NamespaceManager _nsMgr
XmlAttributeNode AddAttribute()

References System.Xml.XmlBaseReader._nsMgr, System.Xml.XmlBaseReader.NamespaceManager.AddAttribute(), System.Xml.Dictionary, System.SR.Format(), System.Xml.PrefixHandle.IsEmpty, System.Xml.StringHandle.IsEmpty, System.Xml.PrefixHandle.IsXml, System.Xml.PrefixHandle.IsXmlns, System.Xml.XmlBaseReader.Namespace.Prefix, System.Xml.XmlBaseReader.NamespaceManager.Register(), System.Xml.XmlExceptionHelper.ThrowEmptyNamespace(), System.Xml.XmlExceptionHelper.ThrowXmlException(), System.Xml.XmlBaseReader.Namespace.Uri, System.Xml.XmlException, and System.SR.XmlSpecificBindingPrefix.

Referenced by System.Xml.XmlUTF8TextReader.ReadAttributes(), System.Xml.XmlBinaryReader.ReadAttributes2(), and System.Runtime.Serialization.Json.XmlJsonReader.SetJsonNameWithMapping().