**** Merged from MCS ****
[mono-project.git] / mcs / class / Microsoft.Web.Services / Microsoft.Web.Services.Addressing / AttributedQName.cs
blob3db0be6e39a9230df54f2353cdd15df9066aba91
1 //
2 // Microsoft.Web.Services.Addressing.AttributedQName.cs
3 //
4 // Author: Todd Berman <tberman@gentoo.org>
5 //
6 // (C) 2003 Todd Berman
8 using System;
9 using System.Xml;
10 using Microsoft.Web.Services.Xml;
12 namespace Microsoft.Web.Services.Addressing
15 public class AttributedQName : OpenAttributeElement
18 private QualifiedName _qname;
20 public AttributedQName (QualifiedName qname) : base ()
22 if(qname == null) {
23 throw new ArgumentNullException ("qname");
25 _qname = qname;
28 public AttributedQName () : base ()
32 public void GetXmlQName (XmlDocument document, XmlElement element)
34 if(document == null) {
35 throw new ArgumentNullException ("document");
37 if(element == null) {
38 throw new ArgumentNullException ("document");
41 GetXmlAny (document, element);
42 _qname.GetQualifiedName (document, element);
45 public void LoadXmlQName (XmlElement element)
47 ValidateSchema (element);
49 LoadXmlAny (element);
51 _qname = QualifiedName.FromString (element.InnerText, element);
54 public void ValidateSchema (XmlElement element)
56 if(element.ChildNodes.Count > 1) {
57 throw new AddressingFormatException ("wsa_InvalidQName");
61 public QualifiedName Value {
62 get { return _qname; }
63 set { _qname = value; }