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

◆ WriteStartAttribute() [3/4]

override void System.Xml.XmlWellFormedWriter.WriteStartAttribute ( string prefix,
string localName,
string namespaceName )
inline

Definition at line 1587 of file XmlWellFormedWriter.cs.

1588 {
1589 try
1590 {
1591 if (localName == null || localName.Length == 0)
1592 {
1593 if (!(prefix == "xmlns"))
1594 {
1596 }
1597 localName = "xmlns";
1598 prefix = string.Empty;
1599 }
1600 CheckNCName(localName);
1601 AdvanceState(Token.StartAttribute);
1602 if (prefix == null)
1603 {
1604 if (namespaceName != null && (!(localName == "xmlns") || !(namespaceName == "http://www.w3.org/2000/xmlns/")))
1605 {
1607 }
1608 if (prefix == null)
1609 {
1610 prefix = string.Empty;
1611 }
1612 }
1613 if (namespaceName == null)
1614 {
1615 if (prefix.Length > 0)
1616 {
1618 }
1619 if (namespaceName == null)
1620 {
1621 namespaceName = string.Empty;
1622 }
1623 }
1624 if (prefix.Length == 0)
1625 {
1626 if (localName[0] != 'x' || !(localName == "xmlns"))
1627 {
1628 if (namespaceName.Length > 0)
1629 {
1631 if (prefix == null || prefix.Length == 0)
1632 {
1634 }
1635 }
1636 goto IL_01fd;
1637 }
1638 if (namespaceName.Length > 0 && namespaceName != "http://www.w3.org/2000/xmlns/")
1639 {
1641 }
1642 _curDeclPrefix = string.Empty;
1643 SetSpecialAttribute(SpecialAttribute.DefaultXmlns);
1644 }
1645 else
1646 {
1647 if (prefix[0] != 'x')
1648 {
1649 goto IL_01c9;
1650 }
1651 if (prefix == "xmlns")
1652 {
1653 if (namespaceName.Length > 0 && namespaceName != "http://www.w3.org/2000/xmlns/")
1654 {
1656 }
1657 _curDeclPrefix = localName;
1658 SetSpecialAttribute(SpecialAttribute.PrefixedXmlns);
1659 }
1660 else
1661 {
1662 if (!(prefix == "xml"))
1663 {
1664 goto IL_01c9;
1665 }
1666 if (namespaceName.Length > 0 && namespaceName != "http://www.w3.org/XML/1998/namespace")
1667 {
1669 }
1670 if (!(localName == "space"))
1671 {
1672 if (!(localName == "lang"))
1673 {
1674 goto IL_01c9;
1675 }
1676 SetSpecialAttribute(SpecialAttribute.XmlLang);
1677 }
1678 else
1679 {
1680 SetSpecialAttribute(SpecialAttribute.XmlSpace);
1681 }
1682 }
1683 }
1684 goto IL_020d;
1685 IL_01c9:
1687 if (namespaceName.Length == 0)
1688 {
1689 prefix = string.Empty;
1690 }
1691 else
1692 {
1694 if (text != null && text != namespaceName)
1695 {
1697 }
1698 }
1699 goto IL_01fd;
1700 IL_01fd:
1701 if (prefix.Length != 0)
1702 {
1704 }
1705 goto IL_020d;
1706 IL_020d:
1707 AddAttribute(prefix, localName, namespaceName);
1708 if (_specAttr == SpecialAttribute.No)
1709 {
1711 }
1712 }
1713 catch
1714 {
1715 _currentState = State.Error;
1716 throw;
1717 }
1718 }
static string Xml_XmlPrefix
Definition SR.cs:304
static string Xml_EmptyLocalName
Definition SR.cs:294
static string Xml_XmlnsPrefix
Definition SR.cs:306
Definition SR.cs:7
void AddAttribute(string prefix, string localName, string namespaceName)
void PushNamespaceImplicit(string prefix, string ns)
string LookupLocalNamespace(string prefix)
void SetSpecialAttribute(SpecialAttribute special)
override string LookupPrefix(string ns)
void WriteStartAttribute(string localName, string? ns)
Definition XmlWriter.cs:67

References System.Xml.XmlWellFormedWriter._curDeclPrefix, System.Xml.XmlWellFormedWriter._currentState, System.Xml.XmlWellFormedWriter._specAttr, System.Xml.XmlWellFormedWriter._writer, System.Xml.XmlWellFormedWriter.AddAttribute(), System.Xml.XmlWellFormedWriter.AdvanceState(), System.Xml.ArgumentException, System.Xml.XmlWellFormedWriter.CheckNCName(), System.Xml.Dictionary, System.Xml.XmlWellFormedWriter.GeneratePrefix(), System.Xml.XmlWellFormedWriter.LookupLocalNamespace(), System.Xml.XmlWellFormedWriter.LookupNamespace(), System.Xml.XmlWellFormedWriter.LookupPrefix(), System.prefix, System.Xml.XmlWellFormedWriter.PushNamespaceImplicit(), System.Xml.XmlWellFormedWriter.SetSpecialAttribute(), System.text, System.Xml.XmlWriter.WriteStartAttribute(), System.SR.Xml_EmptyLocalName, System.SR.Xml_XmlnsPrefix, and System.SR.Xml_XmlPrefix.