mscorlib(4.0.0.0) API with additions
XmlSchemaAny.cs
2 using System.Text;
4 
5 namespace System.Xml.Schema
6 {
9  {
10  private string ns;
11 
12  private XmlSchemaContentProcessing processContents;
13 
14  private NamespaceList namespaceList;
15 
18  [XmlAttribute("namespace")]
19  public string Namespace
20  {
21  get
22  {
23  return ns;
24  }
25  set
26  {
27  ns = value;
28  }
29  }
30 
33  [XmlAttribute("processContents")]
34  [DefaultValue(XmlSchemaContentProcessing.None)]
36  {
37  get
38  {
39  return processContents;
40  }
41  set
42  {
43  processContents = value;
44  }
45  }
46 
47  [XmlIgnore]
48  internal NamespaceList NamespaceList
49  {
50  get
51  {
52  return namespaceList;
53  }
54  }
55 
56  [XmlIgnore]
57  internal string ResolvedNamespace
58  {
59  get
60  {
61  if (ns == null || ns.Length == 0)
62  {
63  return "##any";
64  }
65  return ns;
66  }
67  }
68 
69  [XmlIgnore]
70  internal XmlSchemaContentProcessing ProcessContentsCorrect
71  {
72  get
73  {
74  if (processContents != 0)
75  {
76  return processContents;
77  }
78  return XmlSchemaContentProcessing.Strict;
79  }
80  }
81 
82  internal override string NameString
83  {
84  get
85  {
86  switch (namespaceList.Type)
87  {
88  case NamespaceList.ListType.Any:
89  return "##any:*";
90  case NamespaceList.ListType.Other:
91  return "##other:*";
92  case NamespaceList.ListType.Set:
93  {
94  StringBuilder stringBuilder = new StringBuilder();
95  int num = 1;
96  foreach (string item in namespaceList.Enumerate)
97  {
98  stringBuilder.Append(item + ":*");
99  if (num < namespaceList.Enumerate.Count)
100  {
101  stringBuilder.Append(" ");
102  }
103  num++;
104  }
105  return stringBuilder.ToString();
106  }
107  default:
108  return string.Empty;
109  }
110  }
111  }
112 
113  internal void BuildNamespaceList(string targetNamespace)
114  {
115  if (ns != null)
116  {
117  namespaceList = new NamespaceList(ns, targetNamespace);
118  }
119  else
120  {
121  namespaceList = new NamespaceList();
122  }
123  }
124 
125  internal void BuildNamespaceListV1Compat(string targetNamespace)
126  {
127  if (ns != null)
128  {
129  namespaceList = new NamespaceListV1Compat(ns, targetNamespace);
130  }
131  else
132  {
133  namespaceList = new NamespaceList();
134  }
135  }
136 
137  internal bool Allows(XmlQualifiedName qname)
138  {
139  return namespaceList.Allows(qname.Namespace);
140  }
141  }
142 }
unsafe override string ToString()
Converts the value of this instance to a T:System.String.
Definition: __Canon.cs:3
Represents an attribute. Valid and default values for the attribute are defined in a document type de...
Definition: XmlAttribute.cs:7
Represents the World Wide Web Consortium (W3C) any element.
Definition: XmlSchemaAny.cs:8
StringBuilder Append(char value, int repeatCount)
Appends a specified number of copies of the string representation of a Unicode character to this inst...
Represents a mutable string of characters. This class cannot be inherited.To browse the ....
XmlSchemaContentProcessing ProcessContents
Gets or sets information about how an application or XML processor should handle the validation of XM...
Definition: XmlSchemaAny.cs:36
string Namespace
Gets or sets the namespaces containing the elements that can be used.
Definition: XmlSchemaAny.cs:20
XmlSchemaContentProcessing
Provides information about the validation mode of any and anyAttribute element replacements.
Abstract class for that is the base class for all particle types (e.g. T:System.Xml....