XmlDocumentFragment.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // System.Xml.XmlDocumentFragment
  3. //
  4. // Author:
  5. // Duncan Mak ([email protected])
  6. //
  7. // (C), Ximian, Inc
  8. //
  9. using System;
  10. namespace System.Xml
  11. {
  12. public class XmlDocumentFragment : XmlNode
  13. {
  14. #region Constructor
  15. protected internal XmlDocumentFragment (XmlDocument doc)
  16. : base (doc)
  17. {
  18. }
  19. #endregion
  20. #region Properties
  21. [MonoTODO]
  22. public override string InnerXml {
  23. set { throw new NotImplementedException (); }
  24. get { throw new NotImplementedException (); }
  25. }
  26. public override string LocalName {
  27. get { return "#document-fragment"; }
  28. }
  29. public override string Name {
  30. get { return "#document-fragment"; }
  31. }
  32. public override XmlNodeType NodeType {
  33. get { return XmlNodeType.DocumentFragment; }
  34. }
  35. public override XmlDocument OwnerDocument {
  36. get { return base.OwnerDocument; }
  37. }
  38. public override XmlNode ParentNode {
  39. get { return null; } // it's always null here.
  40. }
  41. #endregion
  42. #region Methods
  43. public override XmlNode CloneNode (bool deep)
  44. {
  45. if (deep) { // clone document + child nodes
  46. XmlNode node = FirstChild;
  47. while ((node != null) && (node.HasChildNodes)) {
  48. AppendChild (node.NextSibling.CloneNode (false));
  49. node = node.NextSibling;
  50. }
  51. return node;
  52. } else
  53. return new XmlDocumentFragment (OwnerDocument);
  54. }
  55. [MonoTODO]
  56. public override void WriteContentTo (XmlWriter w)
  57. {
  58. throw new NotImplementedException ();
  59. }
  60. [MonoTODO]
  61. public override void WriteTo (XmlWriter w)
  62. {
  63. throw new NotImplementedException ();
  64. }
  65. #endregion
  66. }
  67. }