Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2004-01-07 15:26:28 +0300
committerAtsushi Eno <atsushieno@gmail.com>2004-01-07 15:26:28 +0300
commitaa61a23fc0fe570ae785e8c22d69124e1c07a855 (patch)
tree97efc7386484ed011706deca8e74efa88eee2e3f /mcs/class/System.XML/System.Xml/XmlElement.cs
parent5ceb140949bbb1f1b61d999b109494e68ad8cb5f (diff)
2004-01-07 Atsushi Enomoto <atsushi@ximian.com>
* XmlAttribute.cs, XmlDocument.cs, XmlElement.cs : set_Prefix should atomize to name table. Avoided extraneous atomization attempt a bit. svn path=/trunk/mcs/; revision=21803
Diffstat (limited to 'mcs/class/System.XML/System.Xml/XmlElement.cs')
-rw-r--r--mcs/class/System.XML/System.Xml/XmlElement.cs21
1 files changed, 14 insertions, 7 deletions
diff --git a/mcs/class/System.XML/System.Xml/XmlElement.cs b/mcs/class/System.XML/System.Xml/XmlElement.cs
index 2b4e6ef288a..18d6f9716cf 100644
--- a/mcs/class/System.XML/System.Xml/XmlElement.cs
+++ b/mcs/class/System.XML/System.Xml/XmlElement.cs
@@ -36,11 +36,18 @@ namespace System.Xml
string prefix,
string localName,
string namespaceURI,
- XmlDocument doc) : base (doc)
+ XmlDocument doc,
+ bool atomizedNames) : base (doc)
{
- this.prefix = doc.NameTable.Add (prefix);
- this.localName = doc.NameTable.Add (localName);
- this.namespaceURI = doc.NameTable.Add (namespaceURI);
+ if (atomizedNames) {
+ this.prefix = prefix;
+ this.localName = localName;
+ this.namespaceURI = namespaceURI;
+ } else {
+ this.prefix = doc.NameTable.Add (prefix);
+ this.localName = doc.NameTable.Add (localName);
+ this.namespaceURI = doc.NameTable.Add (namespaceURI);
+ }
attributes = new XmlAttributeCollection (this);
@@ -177,7 +184,7 @@ namespace System.Xml
if (!XmlChar.IsNCName (value))
throw new ArgumentException ("Specified name is not a valid NCName: " + value);
- prefix = value;
+ prefix = OwnerDocument.NameTable.Add (value);
}
}
@@ -188,7 +195,7 @@ namespace System.Xml
public override XmlNode CloneNode (bool deep)
{
XmlElement node = new XmlElement (
- prefix, localName, namespaceURI, OwnerDocument);
+ prefix, localName, namespaceURI, OwnerDocument, true);
for (int i = 0; i < Attributes.Count; i++)
node.SetAttributeNode ((XmlAttribute)
@@ -329,7 +336,7 @@ namespace System.Xml
public virtual XmlAttribute SetAttributeNode (string localName, string namespaceURI)
{
XmlDocument xmlDoc = this.OwnerDocument;
- XmlAttribute xmlAttribute = new XmlAttribute (String.Empty, localName, namespaceURI, xmlDoc);
+ XmlAttribute xmlAttribute = new XmlAttribute (String.Empty, localName, namespaceURI, xmlDoc, false);
return this.attributes.Append (xmlAttribute);
}