| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- //
- // XPathEditableNavigator.cs
- //
- // Author:
- // Atsushi Enomoto <[email protected]>
- //
- // (C)2003 Atsushi Enomoto
- //
- //
- // Permission is hereby granted, free of charge, to any person obtaining
- // a copy of this software and associated documentation files (the
- // "Software"), to deal in the Software without restriction, including
- // without limitation the rights to use, copy, modify, merge, publish,
- // distribute, sublicense, and/or sell copies of the Software, and to
- // permit persons to whom the Software is furnished to do so, subject to
- // the following conditions:
- //
- // The above copyright notice and this permission notice shall be
- // included in all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- //
- #if NET_2_0
- using System;
- using System.Collections;
- using System.Collections.Specialized;
- using System.ComponentModel;
- using System.IO;
- using System.Security.Policy;
- using System.Xml.Schema;
- using System.Xml.XPath;
- //using Mono.Xml.XPath2;
- //using MS.Internal.Xml;
- namespace System.Xml
- {
- public abstract class XPathEditableNavigator
- : XPathNavigator, IXPathEditable
- {
- protected XPathEditableNavigator ()
- {
- }
- public abstract XmlWriter AppendChild ();
- public virtual XPathEditableNavigator AppendChild (
- string xmlFragments)
- {
- // FIXME: should XmlParserContext be something?
- return AppendChild (new XmlTextReader (xmlFragments, XmlNodeType.Element, null));
- }
- [MonoTODO]
- public virtual XPathEditableNavigator AppendChild (
- XmlReader reader)
- {
- XmlWriter w = AppendChild ();
- w.WriteNode (reader, false);
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual XPathEditableNavigator AppendChild (
- XPathNavigator nav)
- {
- throw new NotImplementedException ();
- // AppendChild (new XPathNavigatorReader (nav));
- }
- public void AppendChildElement (string prefix, string name, string ns, string value)
- {
- XmlWriter xw = AppendChild ();
- xw.WriteStartElement (prefix, name, ns);
- xw.WriteString (value);
- xw.WriteEndElement ();
- xw.Close ();
- }
- public virtual void CreateAttribute (string prefix, string localName, string namespaceURI, string value)
- {
- using (XmlWriter w = CreateAttributes ()) {
- w.WriteAttributeString (prefix, localName, namespaceURI, value);
- }
- }
- public abstract XmlWriter CreateAttributes ();
- public virtual XPathEditableNavigator CreateEditor ()
- {
- return (XPathEditableNavigator) Clone ();
- }
- // LAMESPEC: documented as public abstract, but it conflicts
- // with XPathNavigator.CreateNavigator ().
- // public abstract XPathNavigator CreateNavigator ();
- public abstract bool DeleteCurrent ();
- public abstract XmlWriter InsertAfter ();
- public virtual XPathEditableNavigator InsertAfter (string xmlFragments)
- {
- return InsertAfter (new XmlTextReader (xmlFragments, XmlNodeType.Element, null));
- }
- [MonoTODO]
- public virtual XPathEditableNavigator InsertAfter (XmlReader reader)
- {
- using (XmlWriter w = InsertAfter ()) {
- w.WriteNode (reader, false);
- }
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual XPathEditableNavigator InsertAfter (XPathNavigator nav)
- {
- // InsertAfter (new XPathNavigatorReader (nav));
- throw new NotImplementedException ();
- }
- public abstract XmlWriter InsertBefore ();
- public virtual XPathEditableNavigator InsertBefore (string xmlFragments)
- {
- return InsertBefore (new XmlTextReader (xmlFragments, XmlNodeType.Element, null));
- }
- [MonoTODO]
- public virtual XPathEditableNavigator InsertBefore (XmlReader reader)
- {
- using (XmlWriter w = InsertBefore ()) {
- w.WriteNode (reader, false);
- }
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual XPathEditableNavigator InsertBefore (XPathNavigator nav)
- {
- // InsertBefore (new XPathNavigatorReader (nav));
- throw new NotImplementedException ();
- }
- public virtual void InsertElementAfter (string prefix,
- string localName, string namespaceURI, string value)
- {
- using (XmlWriter w = InsertAfter ()) {
- w.WriteElementString (prefix, localName, namespaceURI, value);
- }
- }
- public virtual void InsertElementBefore (string prefix,
- string localName, string namespaceURI, string value)
- {
- using (XmlWriter w = InsertBefore ()) {
- w.WriteElementString (prefix, localName, namespaceURI, value);
- }
- }
- public abstract XmlWriter PrependChild ();
- public virtual XPathEditableNavigator PrependChild (string xmlFragments)
- {
- return PrependChild (new XmlTextReader (xmlFragments, XmlNodeType.Element, null));
- }
- [MonoTODO]
- public virtual XPathEditableNavigator PrependChild (XmlReader reader)
- {
- using (XmlWriter w = PrependChild ()) {
- w.WriteNode (reader, false);
- }
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual XPathEditableNavigator PrependChild (XPathNavigator nav)
- {
- // PrependChild (new XPathNavigatorReader (nav));
- throw new NotImplementedException ();
- }
- public virtual void PrependChildElement (string prefix,
- string localName, string namespaceURI, string value)
- {
- using (XmlWriter w = PrependChild ()) {
- w.WriteElementString (prefix, localName, namespaceURI, value);
- }
- }
- // Dunno the exact purpose, but maybe internal editor use
- [MonoTODO]
- public virtual void SetFromObject (object value)
- {
- throw new NotImplementedException ();
- }
- public abstract void SetValue (object value);
- [MonoTODO]
- public virtual void Validate (XmlSchemaSet schemas, ValidationEventHandler handler)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void Validate (XmlSchemaSet schemas, ValidationEventHandler handler, XmlSchemaAttribute attribute)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void Validate (XmlSchemaSet schemas, ValidationEventHandler handler, XmlSchemaElement element)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void Validate (XmlSchemaSet schemas, ValidationEventHandler handler, XmlSchemaType schemaType)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override string InnerXml {
- get { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public override string OuterXml {
- get { throw new NotImplementedException (); }
- }
- }
- }
- #endif
|