2 // System.Xml.XmlDocument
5 // Daniel Weber (daniel-weber@austin.rr.com)
6 // Kral Ferch <kral_ferch@hotmail.com>
7 // Jason Diamond <jason@injektilo.org>
8 // Miguel de Icaza (miguel@ximian.com)
9 // Duncan Mak (duncan@ximian.com)
10 // Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
12 // (C) 2001 Daniel Weber
13 // (C) 2002 Kral Ferch, Jason Diamond, Miguel de Icaza, Duncan Mak,
20 using System.Xml.XPath;
21 using System.Diagnostics;
22 using System.Collections;
26 public class XmlDocument : XmlNode
30 XmlLinkedNode lastLinkedChild;
31 XmlNameTable nameTable;
32 string baseURI = String.Empty;
33 XmlImplementation implementation;
34 bool preserveWhitespace = false;
35 WeakReference reusableXmlTextReader;
41 public XmlDocument () : this (null, null)
45 protected internal XmlDocument (XmlImplementation imp) : this (imp, null)
49 public XmlDocument (XmlNameTable nt) : this (null, nt)
53 XmlDocument (XmlImplementation impl, XmlNameTable nt) : base (null)
55 implementation = (impl != null) ? impl : new XmlImplementation ();
56 nameTable = (nt != null) ? nt : implementation.internalNameTable;
57 AddDefaultNameTableKeys ();
63 public event XmlNodeChangedEventHandler NodeChanged;
65 public event XmlNodeChangedEventHandler NodeChanging;
67 public event XmlNodeChangedEventHandler NodeInserted;
69 public event XmlNodeChangedEventHandler NodeInserting;
71 public event XmlNodeChangedEventHandler NodeRemoved;
73 public event XmlNodeChangedEventHandler NodeRemoving;
79 public override string BaseURI {
85 // Used to read 'InnerXml's for its descendants at any place.
86 internal XmlTextReader ReusableReader {
88 if(reusableXmlTextReader == null)
89 reusableXmlTextReader = new WeakReference (null);
90 if(!reusableXmlTextReader.IsAlive) {
91 XmlTextReader reader = new XmlTextReader ((TextReader)null);
92 reusableXmlTextReader.Target = reader;
94 return (XmlTextReader)reusableXmlTextReader.Target;
98 public XmlElement DocumentElement {
100 XmlNode node = FirstChild;
102 while (node != null) {
103 if (node is XmlElement)
105 node = node.NextSibling;
108 return node != null ? node as XmlElement : null;
112 [MonoTODO("It doesn't have internal subset object model.")]
113 public virtual XmlDocumentType DocumentType {
115 foreach(XmlNode n in this.ChildNodes) {
116 if(n.NodeType == XmlNodeType.DocumentType)
117 return (XmlDocumentType)n;
123 public XmlImplementation Implementation {
124 get { return implementation; }
127 public override string InnerXml {
129 return base.InnerXml;
131 set { // reason for overriding
132 this.LoadXml (value);
136 public override bool IsReadOnly {
137 get { return false; }
140 internal override XmlLinkedNode LastLinkedChild {
142 return lastLinkedChild;
146 lastLinkedChild = value;
150 public override string LocalName {
151 get { return "#document"; }
154 public override string Name {
155 get { return "#document"; }
158 public XmlNameTable NameTable {
159 get { return nameTable; }
162 public override XmlNodeType NodeType {
163 get { return XmlNodeType.Document; }
166 internal override XPathNodeType XPathNodeType {
168 return XPathNodeType.Root;
172 public override XmlDocument OwnerDocument {
176 public bool PreserveWhitespace {
177 get { return preserveWhitespace; }
178 set { preserveWhitespace = value; }
181 internal override string XmlLang {
182 get { return String.Empty; }
186 public virtual XmlResolver XmlResolver {
187 set { throw new NotImplementedException (); }
190 internal override XmlSpace XmlSpace {
192 return XmlSpace.None;
200 [MonoTODO("Should BaseURI be cloned?")]
201 public override XmlNode CloneNode (bool deep)
203 XmlDocument doc = implementation.CreateDocument ();
204 doc.PreserveWhitespace = PreserveWhitespace; // required?
207 foreach(XmlNode n in ChildNodes)
208 doc.AppendChild (doc.ImportNode (n, deep));
213 public XmlAttribute CreateAttribute (string name)
215 return CreateAttribute (name, String.Empty);
218 public XmlAttribute CreateAttribute (string qualifiedName, string namespaceURI)
223 ParseName (qualifiedName, out prefix, out localName);
225 return CreateAttribute (prefix, localName, namespaceURI);
228 public virtual XmlAttribute CreateAttribute (string prefix, string localName, string namespaceURI)
230 if ((localName == null) || (localName == String.Empty))
231 throw new ArgumentException ("The attribute local name cannot be empty.");
233 return new XmlAttribute (prefix, localName, namespaceURI, this);
236 public virtual XmlCDataSection CreateCDataSection (string data)
238 return new XmlCDataSection (data, this);
241 public virtual XmlComment CreateComment (string data)
243 return new XmlComment (data, this);
247 protected internal virtual XmlAttribute CreateDefaultAttribute (string prefix, string localName, string namespaceURI)
249 throw new NotImplementedException ();
252 public virtual XmlDocumentFragment CreateDocumentFragment ()
254 return new XmlDocumentFragment (this);
257 public virtual XmlDocumentType CreateDocumentType (string name, string publicId,
258 string systemId, string internalSubset)
260 return new XmlDocumentType (name, publicId, systemId, internalSubset, this);
263 public XmlElement CreateElement (string name)
265 return CreateElement (name, String.Empty);
268 public XmlElement CreateElement (
269 string qualifiedName,
275 ParseName (qualifiedName, out prefix, out localName);
277 return CreateElement (prefix, localName, namespaceURI);
280 public virtual XmlElement CreateElement (
285 if ((localName == null) || (localName == String.Empty))
286 throw new ArgumentException ("The local name for elements or attributes cannot be null or an empty string.");
287 CheckName (localName);
288 return new XmlElement (prefix != null ? prefix : String.Empty, localName, namespaceURI != null ? namespaceURI : String.Empty, this);
291 public virtual XmlEntityReference CreateEntityReference (string name)
293 return new XmlEntityReference (name, this);
297 internal protected virtual XPathNavigator CreateNavigator (XmlNode node)
299 throw new NotImplementedException ();
302 public virtual XmlNode CreateNode (
303 string nodeTypeString,
307 return CreateNode (GetNodeTypeFromString (nodeTypeString), name, namespaceURI);
310 public virtual XmlNode CreateNode (
315 string prefix = null;
316 string localName = name;
318 if ((type == XmlNodeType.Attribute) || (type == XmlNodeType.Element) || (type == XmlNodeType.EntityReference))
319 ParseName (name, out prefix, out localName);
321 return CreateNode (type, prefix, localName, namespaceURI);
324 public virtual XmlNode CreateNode (
331 case XmlNodeType.Attribute: return CreateAttribute (prefix, name, namespaceURI);
332 case XmlNodeType.CDATA: return CreateCDataSection (null);
333 case XmlNodeType.Comment: return CreateComment (null);
334 case XmlNodeType.Document: return new XmlDocument (); // TODO - test to see which constructor to use, i.e. use existing NameTable or not.
335 case XmlNodeType.DocumentFragment: return CreateDocumentFragment ();
336 case XmlNodeType.DocumentType: return CreateDocumentType (null, null, null, null);
337 case XmlNodeType.Element: return CreateElement (prefix, name, namespaceURI);
338 case XmlNodeType.EntityReference: return CreateEntityReference (null);
339 case XmlNodeType.ProcessingInstruction: return CreateProcessingInstruction (null, null);
340 case XmlNodeType.SignificantWhitespace: return CreateSignificantWhitespace (String.Empty);
341 case XmlNodeType.Text: return CreateTextNode (null);
342 case XmlNodeType.Whitespace: return CreateWhitespace (String.Empty);
343 case XmlNodeType.XmlDeclaration: return CreateXmlDeclaration ("1.0", null, null);
344 default: throw new ArgumentOutOfRangeException(String.Format("{0}\nParameter name: {1}",
345 "Specified argument was out of the range of valid values", type.ToString ()));
349 public virtual XmlProcessingInstruction CreateProcessingInstruction (
353 return new XmlProcessingInstruction (target, data, this);
356 public virtual XmlSignificantWhitespace CreateSignificantWhitespace (string text)
358 foreach (char c in text)
359 if ((c != ' ') && (c != '\r') && (c != '\n') && (c != '\t'))
360 throw new ArgumentException ("Invalid whitespace characters.");
362 return new XmlSignificantWhitespace (text, this);
365 public virtual XmlText CreateTextNode (string text)
367 return new XmlText (text, this);
370 public virtual XmlWhitespace CreateWhitespace (string text)
372 foreach (char c in text)
373 if ((c != ' ') && (c != '\r') && (c != '\n') && (c != '\t'))
374 throw new ArgumentException ("Invalid whitespace characters.");
376 return new XmlWhitespace (text, this);
379 public virtual XmlDeclaration CreateXmlDeclaration (string version, string encoding,
382 if (version != "1.0")
383 throw new ArgumentException ("version string is not correct.");
385 if ((standalone != null && standalone != String.Empty) && !((standalone == "yes") || (standalone == "no")))
386 throw new ArgumentException ("standalone string is not correct.");
388 return new XmlDeclaration (version, encoding, standalone, this);
392 public virtual XmlElement GetElementById (string elementId)
394 throw new NotImplementedException ();
397 public virtual XmlNodeList GetElementsByTagName (string name)
399 ArrayList nodeArrayList = new ArrayList ();
400 this.searchNodesRecursively (this, name, nodeArrayList);
401 return new XmlNodeArrayList (nodeArrayList);
404 private void searchNodesRecursively (XmlNode argNode, string argName,
405 ArrayList argArrayList)
407 XmlNodeList xmlNodeList = argNode.ChildNodes;
408 foreach (XmlNode node in xmlNodeList){
409 if (node.Name.Equals (argName))
410 argArrayList.Add (node);
412 this.searchNodesRecursively (node, argName, argArrayList);
416 private void searchNodesRecursively (XmlNode argNode, string argName, string argNamespaceURI,
417 ArrayList argArrayList)
419 XmlNodeList xmlNodeList = argNode.ChildNodes;
420 foreach (XmlNode node in xmlNodeList){
421 if (node.LocalName.Equals (argName) && node.NamespaceURI.Equals (argNamespaceURI))
422 argArrayList.Add (node);
424 this.searchNodesRecursively (node, argName, argNamespaceURI, argArrayList);
428 public virtual XmlNodeList GetElementsByTagName (string localName, string namespaceURI)
430 ArrayList nodeArrayList = new ArrayList ();
431 this.searchNodesRecursively (this, localName, namespaceURI, nodeArrayList);
432 return new XmlNodeArrayList (nodeArrayList);
435 private XmlNodeType GetNodeTypeFromString (string nodeTypeString)
437 switch (nodeTypeString) {
438 case "attribute": return XmlNodeType.Attribute;
439 case "cdatasection": return XmlNodeType.CDATA;
440 case "comment": return XmlNodeType.Comment;
441 case "document": return XmlNodeType.Document;
442 case "documentfragment": return XmlNodeType.DocumentFragment;
443 case "documenttype": return XmlNodeType.DocumentType;
444 case "element": return XmlNodeType.Element;
445 case "entityreference": return XmlNodeType.EntityReference;
446 case "processinginstruction": return XmlNodeType.ProcessingInstruction;
447 case "significantwhitespace": return XmlNodeType.SignificantWhitespace;
448 case "text": return XmlNodeType.Text;
449 case "whitespace": return XmlNodeType.Whitespace;
451 throw new ArgumentException(String.Format("The string doesn't represent any node type : {0}.", nodeTypeString));
455 [MonoTODO("default attributes (of imported doc); Entity; Notation")]
456 public virtual XmlNode ImportNode (XmlNode node, bool deep)
458 switch(node.NodeType)
460 case XmlNodeType.Attribute:
462 XmlAttribute src_att = node as XmlAttribute;
463 XmlAttribute dst_att = this.CreateAttribute (src_att.Prefix, src_att.LocalName, src_att.NamespaceURI);
464 dst_att.Value = src_att.Value; // always explicitly specified (whether source is specified or not)
468 case XmlNodeType.CDATA:
469 return this.CreateCDataSection (node.Value);
471 case XmlNodeType.Comment:
472 return this.CreateComment (node.Value);
474 case XmlNodeType.Document:
475 throw new XmlException ("Document cannot be imported.");
477 case XmlNodeType.DocumentFragment:
479 XmlDocumentFragment df = this.CreateDocumentFragment ();
482 foreach(XmlNode n in node.ChildNodes)
484 df.AppendChild (this.ImportNode (n, deep));
490 case XmlNodeType.DocumentType:
491 throw new XmlException ("DocumentType cannot be imported.");
493 case XmlNodeType.Element:
495 XmlElement src = (XmlElement)node;
496 XmlElement dst = this.CreateElement (src.Prefix, src.LocalName, src.NamespaceURI);
497 foreach(XmlAttribute attr in src.Attributes)
499 if(attr.Specified) // copies only specified attributes
500 dst.SetAttributeNode ((XmlAttribute)this.ImportNode (attr, deep));
501 if(DocumentType != null)
503 // TODO: create default attribute values
508 foreach(XmlNode n in src.ChildNodes)
509 dst.AppendChild (this.ImportNode (n, deep));
514 case XmlNodeType.EndElement:
515 throw new XmlException ("Illegal ImportNode call for NodeType.EndElement");
516 case XmlNodeType.EndEntity:
517 throw new XmlException ("Illegal ImportNode call for NodeType.EndEntity");
519 case XmlNodeType.Entity:
520 throw new NotImplementedException (); // TODO
522 case XmlNodeType.EntityReference:
523 return this.CreateEntityReference (node.Name);
525 case XmlNodeType.None:
526 throw new XmlException ("Illegal ImportNode call for NodeType.None");
528 case XmlNodeType.Notation:
529 throw new NotImplementedException (); // TODO
531 case XmlNodeType.ProcessingInstruction:
532 XmlProcessingInstruction pi = node as XmlProcessingInstruction;
533 return this.CreateProcessingInstruction (pi.Target, pi.Data);
535 case XmlNodeType.SignificantWhitespace:
536 return this.CreateSignificantWhitespace (node.Value);
538 case XmlNodeType.Text:
539 return this.CreateTextNode (node.Value);
541 case XmlNodeType.Whitespace:
542 return this.CreateWhitespace (node.Value);
544 case XmlNodeType.XmlDeclaration:
545 XmlDeclaration srcDecl = node as XmlDeclaration;
546 return this.CreateXmlDeclaration (srcDecl.Version, srcDecl.Encoding, srcDecl.Standalone);
549 throw new NotImplementedException ();
553 public virtual void Load (Stream inStream)
555 XmlReader xmlReader = new XmlTextReader (new XmlInputStream (inStream));
559 public virtual void Load (string filename)
562 if (filename.IndexOf (':') != -1) {
563 // While we fix Uri the code that uses it is only triggered by a colon in the filename.
564 Uri uri = new Uri (filename);
565 baseURI = filename; // FIXME: resolve base
566 Stream stream = new XmlUrlResolver ().GetEntity (uri, null, typeof(Stream)) as Stream;
567 XmlReader xmlReader = new XmlTextReader (new XmlStreamReader (new XmlInputStream (stream)));
570 //Remove this once Uri.Parse is fixed.
571 Load (File.OpenRead (filename));
575 public virtual void Load (TextReader txtReader)
577 Load (new XmlTextReader (txtReader));
580 public virtual void Load (XmlReader xmlReader)
582 // Reset our document
583 // For now this just means removing all our children but later this
584 // may turn out o need to call a private method that resets other things
585 // like properties we have, etc.
588 // create all contents with use of ReadNode()
590 XmlNode n = ReadNode (xmlReader);
596 public virtual void LoadXml (string xml)
598 XmlReader xmlReader = new XmlTextReader (new StringReader (xml));
602 internal void onNodeChanged (XmlNode node, XmlNode Parent)
604 if (NodeChanged != null)
605 NodeChanged (node, new XmlNodeChangedEventArgs
606 (XmlNodeChangedAction.Change,
607 node, Parent, Parent));
610 internal void onNodeChanging(XmlNode node, XmlNode Parent)
612 if (NodeChanging != null)
613 NodeChanging (node, new XmlNodeChangedEventArgs
614 (XmlNodeChangedAction.Change,
615 node, Parent, Parent));
618 internal void onNodeInserted (XmlNode node, XmlNode newParent)
620 if (NodeInserted != null)
621 NodeInserted (node, new XmlNodeChangedEventArgs
622 (XmlNodeChangedAction.Insert,
623 node, null, newParent));
626 internal void onNodeInserting (XmlNode node, XmlNode newParent)
628 if (NodeInserting != null)
629 NodeInserting (node, new XmlNodeChangedEventArgs
630 (XmlNodeChangedAction.Insert,
631 node, null, newParent));
634 internal void onNodeRemoved (XmlNode node, XmlNode oldParent)
636 if (NodeRemoved != null)
637 NodeRemoved (node, new XmlNodeChangedEventArgs
638 (XmlNodeChangedAction.Remove,
639 node, oldParent, null));
642 internal void onNodeRemoving (XmlNode node, XmlNode oldParent)
644 if (NodeRemoving != null)
645 NodeRemoving (node, new XmlNodeChangedEventArgs
646 (XmlNodeChangedAction.Remove,
647 node, oldParent, null));
650 private void ParseName (string name, out string prefix, out string localName)
652 int indexOfColon = name.IndexOf (':');
654 if (indexOfColon != -1) {
655 prefix = name.Substring (0, indexOfColon);
656 localName = name.Substring (indexOfColon + 1);
663 // Checks that Element's name is valid
664 private void CheckName (String name)
666 // TODO: others validations?
667 if (name.IndexOf (" ") >= 0)
668 throw new XmlException ("The ' ' characted cannot be included in a name");
671 // Reads XmlReader and creates Attribute Node.
672 private XmlAttribute ReadAttributeNode(XmlReader reader)
674 if(reader.NodeType == XmlNodeType.Element)
675 reader.MoveToFirstAttribute ();
676 else if(reader.NodeType != XmlNodeType.Attribute)
677 throw new InvalidOperationException ("bad position to read attribute.");
678 XmlAttribute attribute = CreateAttribute (reader.Prefix, reader.LocalName, reader.NamespaceURI);
679 ReadAttributeNodeValue (reader, attribute);
683 // Reads attribute from XmlReader and then creates attribute value children. XmlAttribute also uses this.
684 internal void ReadAttributeNodeValue(XmlReader reader, XmlAttribute attribute)
686 while(reader.ReadAttributeValue ()) {
687 if(reader.NodeType == XmlNodeType.EntityReference)
688 // FIXME: if DocumentType is available, then try to resolve it.
689 attribute.AppendChild (CreateEntityReference (reader.Name));
690 // FIXME: else if(NodeType == EndEntity) -- reset BaseURI and so on -- ;
692 // (IMHO) Children of Attribute is likely restricted to Text and EntityReference.
693 attribute.AppendChild (CreateTextNode (reader.Value));
697 [MonoTODO("DTD parser is not completed.")]
698 public virtual XmlNode ReadNode(XmlReader reader)
700 // This logic was formerly defined in 'XmlNode.ConstructDOM()'
702 XmlNode resultNode = null;
703 XmlNode newNode = null;
704 XmlNode currentNode = null;
705 // It was originally XmlDocument.Load(reader reader) when mcs was v0.16.
706 int startDepth = reader.Depth;
708 bool ignoredWhitespace;
709 bool reachedEOF = false;
712 ignoredWhitespace = false;
714 if (reader.NodeType == XmlNodeType.None)
716 throw new Exception ("XML Reader reached to end while reading node.");
719 // This complicated check is because we shouldn't make
720 // improper additional XmlReader.Read() by this method itself.
721 if(atStart && (reader.NodeType == XmlNodeType.EndElement ||
722 reader.NodeType == XmlNodeType.EndEntity))
723 throw new InvalidOperationException ("the XmlReader now holds invalid position.");
725 switch (reader.NodeType) {
727 case XmlNodeType.Attribute:
728 newNode = ReadAttributeNode (reader);
731 case XmlNodeType.CDATA:
732 newNode = CreateCDataSection (reader.Value);
733 if(currentNode != null)
734 currentNode.AppendChild (newNode);
737 case XmlNodeType.Comment:
738 newNode = CreateComment (reader.Value);
739 if(currentNode != null)
740 currentNode.AppendChild (newNode);
743 case XmlNodeType.Element:
744 XmlElement element = CreateElement (reader.Prefix, reader.LocalName, reader.NamespaceURI);
745 element.IsEmpty = reader.IsEmptyElement;
746 if(currentNode != null)
747 currentNode.AppendChild (element);
749 resultNode = element;
751 // set the element's attributes.
752 while (reader.MoveToNextAttribute ()) {
753 element.SetAttributeNode (ReadAttributeNode (reader));
756 reader.MoveToElement ();
758 if (!reader.IsEmptyElement)
759 currentNode = element;
763 case XmlNodeType.EndElement:
764 if(currentNode.Name != reader.Name)
765 throw new XmlException ("mismatch end tag.");
766 currentNode = currentNode.ParentNode;
769 case XmlNodeType.EndEntity:
770 break; // no operation
772 case XmlNodeType.ProcessingInstruction:
773 newNode = CreateProcessingInstruction (reader.Name, reader.Value);
774 if(currentNode != null)
775 currentNode.AppendChild (newNode);
778 case XmlNodeType.Text:
779 newNode = CreateTextNode (reader.Value);
780 if(currentNode != null)
781 currentNode.AppendChild (newNode);
784 case XmlNodeType.XmlDeclaration:
785 // empty strings are dummy, then gives over setting value contents to setter.
786 newNode = CreateXmlDeclaration ("1.0" , String.Empty, String.Empty);
787 ((XmlDeclaration)newNode).Value = reader.Value;
788 if(currentNode != null)
789 throw new XmlException ("XmlDeclaration at invalid position.");
792 case XmlNodeType.DocumentType:
793 // This logic is kinda hack;-)
794 XmlTextReader xtReader = reader as XmlTextReader;
795 if(xtReader == null) {
796 xtReader = new XmlTextReader (reader.ReadOuterXml (),
797 XmlNodeType.DocumentType,
798 new XmlParserContext (NameTable, ConstructNamespaceManager(), XmlLang, XmlSpace));
801 newNode = CreateDocumentType (xtReader.Name,
802 xtReader.GetAttribute ("PUBLIC"),
803 xtReader.GetAttribute ("SYSTEM"),
805 if(currentNode != null)
806 throw new XmlException ("XmlDocumentType at invalid position.");
809 case XmlNodeType.EntityReference:
810 newNode = CreateEntityReference (reader.Name);
811 if(currentNode != null)
812 currentNode.AppendChild (newNode);
815 case XmlNodeType.SignificantWhitespace:
816 newNode = CreateSignificantWhitespace (reader.Value);
817 if(currentNode != null)
818 currentNode.AppendChild (newNode);
821 case XmlNodeType.Whitespace:
822 if(PreserveWhitespace) {
823 newNode = CreateWhitespace (reader.Value);
824 if(currentNode != null)
825 currentNode.AppendChild (newNode);
828 ignoredWhitespace = true;
831 } while ((!reader.EOF && ignoredWhitespace) ||
832 reader.Depth > startDepth ||
833 // This complicated condition is because reader.Depth was set
834 // before XmlTextReader.depth increments ;-)
835 (reader.Depth == startDepth && reader.NodeType == XmlNodeType.Element && reader.IsEmptyElement == false)
837 return resultNode != null ? resultNode : newNode;
840 public virtual void Save(Stream outStream)
842 XmlTextWriter xmlWriter = new XmlTextWriter (outStream, Encoding.UTF8);
843 xmlWriter.Formatting = Formatting.Indented;
844 WriteContentTo (xmlWriter);
848 public virtual void Save (string filename)
850 XmlTextWriter xmlWriter = new XmlTextWriter (filename, Encoding.UTF8);
851 xmlWriter.Formatting = Formatting.Indented;
852 WriteContentTo (xmlWriter);
857 public virtual void Save (TextWriter writer)
859 XmlTextWriter xmlWriter = new XmlTextWriter (writer);
860 xmlWriter.Formatting = Formatting.Indented;
861 WriteContentTo (xmlWriter);
865 public virtual void Save (XmlWriter xmlWriter)
868 // This should preserve white space if PreserveWhiteSpace is true
870 WriteContentTo (xmlWriter);
874 public override void WriteContentTo (XmlWriter w)
876 foreach(XmlNode childNode in ChildNodes) {
877 childNode.WriteTo (w);
881 public override void WriteTo (XmlWriter w)
886 private void AddDefaultNameTableKeys ()
888 // The following keys are default of MS .NET Framework
889 nameTable.Add ("#text");
890 nameTable.Add ("xml");
891 nameTable.Add ("xmlns");
892 nameTable.Add ("#entity");
893 nameTable.Add ("#document-fragment");
894 nameTable.Add ("#comment");
895 nameTable.Add ("space");
896 nameTable.Add ("id");
897 nameTable.Add ("#whitespace");
898 nameTable.Add ("http://www.w3.org/2000/xmlns/");
899 nameTable.Add ("#cdata-section");
900 nameTable.Add ("lang");
901 nameTable.Add ("#document");
902 nameTable.Add ("#significant-whitespace");