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

◆ ProcessAttributes() [2/2]

void System.Xml.XmlBaseReader.ProcessAttributes ( XmlAttributeNode[] attributeNodes,
int attributeCount )
inlineprivateinherited

Definition at line 1831 of file XmlBaseReader.cs.

1832 {
1833 for (int i = 0; i < attributeCount; i++)
1834 {
1835 XmlAttributeNode xmlAttributeNode = attributeNodes[i];
1836 if (xmlAttributeNode.QNameType == QNameType.Normal)
1837 {
1838 PrefixHandle prefix = xmlAttributeNode.Prefix;
1839 if (!prefix.IsEmpty)
1840 {
1842 }
1843 else
1844 {
1846 }
1848 }
1849 }
1850 if (attributeCount <= 1)
1851 {
1852 return;
1853 }
1854 if (attributeCount < 12)
1855 {
1856 for (int j = 0; j < attributeCount - 1; j++)
1857 {
1858 XmlAttributeNode xmlAttributeNode2 = attributeNodes[j];
1859 if (xmlAttributeNode2.QNameType == QNameType.Normal)
1860 {
1861 for (int k = j + 1; k < attributeCount; k++)
1862 {
1863 XmlAttributeNode xmlAttributeNode3 = attributeNodes[k];
1864 if (xmlAttributeNode3.QNameType == QNameType.Normal && xmlAttributeNode2.LocalName == xmlAttributeNode3.LocalName && xmlAttributeNode2.Namespace.Uri == xmlAttributeNode3.Namespace.Uri)
1865 {
1866 XmlExceptionHelper.ThrowDuplicateAttribute(this, xmlAttributeNode2.Prefix.GetString(), xmlAttributeNode3.Prefix.GetString(), xmlAttributeNode2.LocalName.GetString(), xmlAttributeNode2.Namespace.Uri.GetString());
1867 }
1868 }
1869 continue;
1870 }
1871 for (int l = j + 1; l < attributeCount; l++)
1872 {
1873 XmlAttributeNode xmlAttributeNode4 = attributeNodes[l];
1874 if (xmlAttributeNode4.QNameType == QNameType.Xmlns && xmlAttributeNode2.Namespace.Prefix == xmlAttributeNode4.Namespace.Prefix)
1875 {
1876 XmlExceptionHelper.ThrowDuplicateAttribute(this, "xmlns", "xmlns", xmlAttributeNode2.Namespace.Prefix.GetString(), "http://www.w3.org/2000/xmlns/");
1877 }
1878 }
1879 }
1880 }
1881 else
1882 {
1883 CheckAttributes(attributeNodes, attributeCount);
1884 }
1885 }
void CheckAttributes(XmlAttributeNode[] attributeNodes, int attributeCount)
override string LookupNamespace(string prefix)
virtual ? XmlNamespaceManager NamespaceManager
Definition XmlReader.cs:126

References System.Xml.XmlBaseReader.CheckAttributes(), System.Xml.Dictionary, System.Xml.XmlBaseReader.NamespaceManager.EmptyNamespace, System.Xml.XmlBaseReader.NamespaceManager.LookupNamespace(), System.prefix, and System.Xml.XmlExceptionHelper.ThrowDuplicateAttribute().