2 // Microsoft.Web.Services.Xml.OpenElement.cs
4 // Author: Todd Berman <tberman@gentoo.org>
6 // (C) 2003 Todd Berman
10 using System.Collections;
12 namespace Microsoft.Web.Services.Xml
15 public abstract class OpenElement
17 private ArrayList _anyAttribute;
18 private ArrayList _anyElement;
22 _anyAttribute = new ArrayList ();
23 _anyElement = new ArrayList ();
26 protected virtual void GetXmlAny (XmlDocument document, XmlElement element)
28 if(document == null) {
29 throw new ArgumentNullException ("document");
32 throw new ArgumentNullException ("element");
35 foreach(XmlAttribute attrib in AnyAttributes) {
36 element.Attributes.Append ((XmlAttribute) document.ImportNode (attrib, true));
39 foreach(XmlElement elem in AnyElements) {
40 element.AppendChild (document.ImportNode (elem, true));
44 protected virtual void LoadXmlAny (XmlElement element)
47 throw new ArgumentNullException ("element");
50 foreach(XmlAttribute attrib in element.Attributes) {
51 AnyAttributes.Add (attrib);
54 foreach(XmlElement elem in element.ChildNodes) {
55 AnyElements.Add (elem);
59 public IList AnyAttributes {
60 get { return _anyAttribute; }
63 public IList AnyElements {
64 get { return _anyElement; }