2 // Microsoft.Web.Services.Addressing.AttributedUri
4 // Author: Todd Berman <tberman@gentoo.org>
6 // (C) 2003 Todd Berman
11 using Microsoft.Web.Services.Xml;
13 namespace Microsoft.Web.Services.Addressing
16 public abstract class AttributedUri : OpenAttributeElement
21 public AttributedUri (Uri uri) : base ()
24 throw new ArgumentNullException ("uri");
30 public AttributedUri (AttributedUri aUri) : base ()
35 foreach (XmlAttribute attribute in aUri.AnyAttributes) {
37 AnyAttributes.Add (attribute);
43 public AttributedUri () : base ()
47 public void GetXmlUri (XmlDocument document, XmlElement element)
50 throw new ArgumentNullException ("element");
53 element.InnerText = _value.ToString();
55 GetXmlAny(document, element);
58 public void LoadXmlUri (XmlElement element)
61 throw new ArgumentNullException ("element");
64 ValidateSchema (element);
68 _value = new Uri(element.InnerText);
72 public void ValidateSchema (XmlElement element)
74 if(element.ChildNodes.Count > 1) {
75 throw new AddressingFormatException ("wsa_InvalidAttributeUri");
77 if(element.ChildNodes.Count == 1 && !(element.FirstChild is XmlText)) {
78 throw new AddressingFormatException ("wsa_InvalidAttributeUri");
83 get { return _value; }
84 set { _value = value; }