XPathEditor.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // XPathEditor.cs
  3. //
  4. // Author:
  5. // Atsushi Enomoto <[email protected]>
  6. //
  7. // (C)2003 Atsushi Enomoto
  8. //
  9. #if NET_1_2
  10. using System;
  11. using System.Collections;
  12. using System.Collections.Specialized;
  13. using System.ComponentModel;
  14. using System.IO;
  15. using System.Security.Policy;
  16. using System.Xml.Schema;
  17. using System.Xml.XPath;
  18. //using Mono.Xml.XPath2;
  19. //using MS.Internal.Xml;
  20. namespace System.Xml
  21. {
  22. public abstract class XPathEditor : XPathNavigator2, IXPathEditor
  23. {
  24. protected XPathEditor ()
  25. {
  26. }
  27. public abstract XPathNavigator2 CloneAsNavigator ();
  28. public abstract XmlWriter CreateAttributes ();
  29. // TODO: Where to use schemaType?
  30. public void CreateAttributeString (string prefix, string name, string ns, XmlSchemaType schemaType, string value)
  31. {
  32. XmlWriter xw = CreateAttributes ();
  33. xw.WriteAttributeString (prefix, name, ns, value);
  34. xw.Close ();
  35. }
  36. public abstract XmlWriter CreateFirstChild ();
  37. public abstract void CreateFirstChild (string xmlFragments);
  38. // TODO: Where to use schemaType?
  39. public void CreateFirstChildElement (string prefix, string name, string ns, XmlSchemaType schemaType, string value)
  40. {
  41. XmlWriter xw = CreateFirstChild ();
  42. xw.WriteStartElement (prefix, name, ns);
  43. xw.WriteString (value);
  44. xw.WriteEndElement ();
  45. xw.Close ();
  46. }
  47. public abstract XmlWriter CreateNextSibling ();
  48. public abstract void CreateNextSibling (string xmlFragment);
  49. // TODO: Where to use schemaType?
  50. public void CreateNextSiblingElement (string prefix, string name, string ns, XmlSchemaType schemaType, string value)
  51. {
  52. XmlWriter xw = CreateNextSibling ();
  53. xw.WriteStartElement (prefix, name, ns);
  54. xw.WriteString (value);
  55. xw.WriteEndElement ();
  56. xw.Close ();
  57. }
  58. public abstract void DeleteCurrent ();
  59. public abstract void SetValue (string text);
  60. }
  61. }
  62. #endif