XmlElement.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
  2. //
  3. // System.Xml.XmlElement
  4. //
  5. // Author:
  6. // Daniel Weber ([email protected])
  7. //
  8. // (C) 2001 Daniel Weber
  9. using System;
  10. namespace System.Xml
  11. {
  12. public class XmlElement : XmlLinkedNode
  13. {
  14. // Private/Protected internal data structures
  15. //===========================================================================
  16. private XmlAttributeCollection _attributes;
  17. // Public Properties
  18. //===========================================================================
  19. /// <summary>
  20. /// Return the XmlAttributeCollection on the Element
  21. /// </summary>
  22. public override XmlAttributeCollection Attributes
  23. {
  24. get
  25. {
  26. // TODO - implement Attributes
  27. return _attributes;
  28. }
  29. }
  30. // Implement abstract methods of XmlNode
  31. //=====================================================================
  32. /// <summary>
  33. /// Remove all children and attributes. If
  34. /// </summary>
  35. public override void RemoveAll()
  36. {
  37. // Remove all child nodes
  38. base.RemoveAll();
  39. // Remove all attributes
  40. _attributes.RemoveAll();
  41. // If we have any default attributes, add them back in with the
  42. // appropriate namespace, baseURI, name, localName
  43. // TODO - implement adding default attributes back in XmlElement.RemoveAll()
  44. }
  45. /// <summary>
  46. /// Return a clone of the node
  47. /// </summary>
  48. /// <param name="deep">Make copy of all children</param>
  49. /// <returns>Cloned node</returns>
  50. public override XmlNode CloneNode( bool deep)
  51. {
  52. // TODO - implement CloneNode()
  53. throw new NotImplementedException();
  54. }
  55. /// <summary>
  56. /// Saves all children of the current node to the passed writer
  57. /// </summary>
  58. /// <param name="w"></param>
  59. public override void WriteContentTo(XmlWriter w)
  60. {
  61. // TODO - implement WriteContentsTo(XmlWriter)
  62. throw new NotImplementedException();
  63. }
  64. /// <summary>
  65. /// Saves the current node to writer w
  66. /// </summary>
  67. /// <param name="w"></param>
  68. public override void WriteTo(XmlWriter w)
  69. {
  70. // TODO - implement WriteTo(XmlWriter)
  71. throw new NotImplementedException();
  72. }
  73. /// <summary>
  74. /// Returns the local name of the node with qualifiers removed
  75. /// LocalName of ns:elementName = "elementName"
  76. /// </summary>
  77. public override string LocalName
  78. {
  79. get
  80. {
  81. // TODO - implement LocalName
  82. throw new NotImplementedException();
  83. }
  84. }
  85. /// <summary>
  86. /// Get the qualified node name
  87. /// derived classes must implement as behavior varies
  88. /// by tag type.
  89. /// </summary>
  90. public override string Name
  91. {
  92. get
  93. {
  94. // TODO - implement Name
  95. throw new NotImplementedException();
  96. }
  97. }
  98. public override XmlNodeType NodeType
  99. {
  100. get
  101. {
  102. return XmlNodeType.Element;
  103. }
  104. }
  105. // ============= Internal calls =============================================
  106. // Constructors
  107. // ==========================================================================
  108. internal XmlElement( XmlDocument aOwnerDoc ) : base(aOwnerDoc)
  109. {
  110. _attributes = new XmlAttributeCollection(aOwnerDoc, this, null);
  111. }
  112. } // class
  113. } //namespace