XmlElement.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. /// <summary>
  31. /// Get/Set the value for this node
  32. /// </summary>
  33. public override string Value
  34. {
  35. get
  36. {
  37. return null;
  38. }
  39. set
  40. {
  41. // Do nothing, can't set value on XmlElement...
  42. }
  43. }
  44. // Implement abstract methods of XmlNode
  45. //=====================================================================
  46. /// <summary>
  47. /// Remove all children and attributes. If
  48. /// </summary>
  49. public override void RemoveAll()
  50. {
  51. // Remove all child nodes
  52. base.RemoveAll();
  53. // Remove all attributes
  54. _attributes.RemoveAll();
  55. // If we have any default attributes, add them back in with the
  56. // appropriate namespace, baseURI, name, localName
  57. // TODO - implement adding default attributes back in XmlElement.RemoveAll()
  58. }
  59. /// <summary>
  60. /// Return a clone of the node
  61. /// </summary>
  62. /// <param name="deep">Make copy of all children</param>
  63. /// <returns>Cloned node</returns>
  64. public override XmlNode CloneNode( bool deep)
  65. {
  66. // TODO - implement CloneNode()
  67. throw new NotImplementedException();
  68. }
  69. /// <summary>
  70. /// Saves all children of the current node to the passed writer
  71. /// </summary>
  72. /// <param name="w"></param>
  73. public override void WriteContentTo(XmlWriter w)
  74. {
  75. // TODO - implement WriteContentsTo(XmlWriter)
  76. throw new NotImplementedException();
  77. }
  78. /// <summary>
  79. /// Saves the current node to writer w
  80. /// </summary>
  81. /// <param name="w"></param>
  82. public override void WriteTo(XmlWriter w)
  83. {
  84. // TODO - implement WriteTo(XmlWriter)
  85. throw new NotImplementedException();
  86. }
  87. /// <summary>
  88. /// Returns the local name of the node with qualifiers removed
  89. /// LocalName of ns:elementName = "elementName"
  90. /// </summary>
  91. public override string LocalName
  92. {
  93. get
  94. {
  95. // TODO - implement LocalName
  96. throw new NotImplementedException();
  97. }
  98. }
  99. /// <summary>
  100. /// Get the qualified node name
  101. /// derived classes must implement as behavior varies
  102. /// by tag type.
  103. /// </summary>
  104. public override string Name
  105. {
  106. get
  107. {
  108. // TODO - implement Name
  109. throw new NotImplementedException();
  110. }
  111. }
  112. public override XmlNodeType NodeType
  113. {
  114. get
  115. {
  116. return XmlNodeType.Element;
  117. }
  118. }
  119. // ============= Internal calls =============================================
  120. // Constructors
  121. // ==========================================================================
  122. internal XmlElement( XmlDocument aOwnerDoc, string elementName ) : base(aOwnerDoc)
  123. {
  124. _attributes = new XmlAttributeCollection(aOwnerDoc, this, null);
  125. }
  126. } // class
  127. } //namespace