mscorlib(4.0.0.0) API with additions
XmlSchema.cs
1 using System.Collections;
3 using System.IO;
4 using System.Threading;
7 
8 namespace System.Xml.Schema
9 {
11  [XmlRoot("schema", Namespace = "http://www.w3.org/2001/XMLSchema")]
12  [global::__DynamicallyInvokable]
13  public class XmlSchema : XmlSchemaObject
14  {
16  public const string Namespace = "http://www.w3.org/2001/XMLSchema";
17 
19  public const string InstanceNamespace = "http://www.w3.org/2001/XMLSchema-instance";
20 
21  private XmlSchemaForm attributeFormDefault;
22 
23  private XmlSchemaForm elementFormDefault;
24 
25  private XmlSchemaDerivationMethod blockDefault = XmlSchemaDerivationMethod.None;
26 
27  private XmlSchemaDerivationMethod finalDefault = XmlSchemaDerivationMethod.None;
28 
29  private string targetNs;
30 
31  private string version;
32 
34 
36 
37  private string id;
38 
39  private XmlAttribute[] moreAttributes;
40 
41  private bool isCompiled;
42 
43  private bool isCompiledBySet;
44 
45  private bool isPreprocessed;
46 
47  private bool isRedefined;
48 
49  private int errorCount;
50 
51  private XmlSchemaObjectTable attributes;
52 
53  private XmlSchemaObjectTable attributeGroups = new XmlSchemaObjectTable();
54 
55  private XmlSchemaObjectTable elements = new XmlSchemaObjectTable();
56 
57  private XmlSchemaObjectTable types = new XmlSchemaObjectTable();
58 
59  private XmlSchemaObjectTable groups = new XmlSchemaObjectTable();
60 
61  private XmlSchemaObjectTable notations = new XmlSchemaObjectTable();
62 
63  private XmlSchemaObjectTable identityConstraints = new XmlSchemaObjectTable();
64 
65  private static int globalIdCounter = -1;
66 
67  private ArrayList importedSchemas;
68 
69  private ArrayList importedNamespaces;
70 
71  private int schemaId = -1;
72 
73  private Uri baseUri;
74 
75  private bool isChameleon;
76 
77  private Hashtable ids = new Hashtable();
78 
79  private XmlDocument document;
80 
81  private XmlNameTable nameTable;
82 
85  [XmlAttribute("attributeFormDefault")]
86  [DefaultValue(XmlSchemaForm.None)]
88  {
89  get
90  {
91  return attributeFormDefault;
92  }
93  set
94  {
95  attributeFormDefault = value;
96  }
97  }
98 
101  [XmlAttribute("blockDefault")]
102  [DefaultValue(XmlSchemaDerivationMethod.None)]
104  {
105  get
106  {
107  return blockDefault;
108  }
109  set
110  {
111  blockDefault = value;
112  }
113  }
114 
117  [XmlAttribute("finalDefault")]
118  [DefaultValue(XmlSchemaDerivationMethod.None)]
120  {
121  get
122  {
123  return finalDefault;
124  }
125  set
126  {
127  finalDefault = value;
128  }
129  }
130 
133  [XmlAttribute("elementFormDefault")]
134  [DefaultValue(XmlSchemaForm.None)]
136  {
137  get
138  {
139  return elementFormDefault;
140  }
141  set
142  {
143  elementFormDefault = value;
144  }
145  }
146 
149  [XmlAttribute("targetNamespace", DataType = "anyURI")]
150  public string TargetNamespace
151  {
152  get
153  {
154  return targetNs;
155  }
156  set
157  {
158  targetNs = value;
159  }
160  }
161 
164  [XmlAttribute("version", DataType = "token")]
165  public string Version
166  {
167  get
168  {
169  return version;
170  }
171  set
172  {
173  version = value;
174  }
175  }
176 
179  [XmlElement("include", typeof(XmlSchemaInclude))]
180  [XmlElement("import", typeof(XmlSchemaImport))]
181  [XmlElement("redefine", typeof(XmlSchemaRedefine))]
183  {
184  get
185  {
186  return includes;
187  }
188  }
189 
192  [XmlElement("annotation", typeof(XmlSchemaAnnotation))]
193  [XmlElement("attribute", typeof(XmlSchemaAttribute))]
194  [XmlElement("attributeGroup", typeof(XmlSchemaAttributeGroup))]
195  [XmlElement("complexType", typeof(XmlSchemaComplexType))]
196  [XmlElement("simpleType", typeof(XmlSchemaSimpleType))]
197  [XmlElement("element", typeof(XmlSchemaElement))]
198  [XmlElement("group", typeof(XmlSchemaGroup))]
199  [XmlElement("notation", typeof(XmlSchemaNotation))]
201  {
202  get
203  {
204  return items;
205  }
206  }
207 
211  [XmlIgnore]
212  public bool IsCompiled
213  {
214  get
215  {
216  if (!isCompiled)
217  {
218  return isCompiledBySet;
219  }
220  return true;
221  }
222  }
223 
224  [XmlIgnore]
225  internal bool IsCompiledBySet
226  {
227  get
228  {
229  return isCompiledBySet;
230  }
231  set
232  {
233  isCompiledBySet = value;
234  }
235  }
236 
237  [XmlIgnore]
238  internal bool IsPreprocessed
239  {
240  get
241  {
242  return isPreprocessed;
243  }
244  set
245  {
246  isPreprocessed = value;
247  }
248  }
249 
250  [XmlIgnore]
251  internal bool IsRedefined
252  {
253  get
254  {
255  return isRedefined;
256  }
257  set
258  {
259  isRedefined = value;
260  }
261  }
262 
265  [XmlIgnore]
266  public XmlSchemaObjectTable Attributes
267  {
268  get
269  {
270  if (attributes == null)
271  {
272  attributes = new XmlSchemaObjectTable();
273  }
274  return attributes;
275  }
276  }
277 
280  [XmlIgnore]
282  {
283  get
284  {
285  if (attributeGroups == null)
286  {
287  attributeGroups = new XmlSchemaObjectTable();
288  }
289  return attributeGroups;
290  }
291  }
292 
295  [XmlIgnore]
297  {
298  get
299  {
300  if (types == null)
301  {
302  types = new XmlSchemaObjectTable();
303  }
304  return types;
305  }
306  }
307 
310  [XmlIgnore]
312  {
313  get
314  {
315  if (elements == null)
316  {
317  elements = new XmlSchemaObjectTable();
318  }
319  return elements;
320  }
321  }
322 
325  [XmlAttribute("id", DataType = "ID")]
326  public string Id
327  {
328  get
329  {
330  return id;
331  }
332  set
333  {
334  id = value;
335  }
336  }
337 
340  [XmlAnyAttribute]
342  {
343  get
344  {
345  return moreAttributes;
346  }
347  set
348  {
349  moreAttributes = value;
350  }
351  }
352 
355  [XmlIgnore]
357  {
358  get
359  {
360  return groups;
361  }
362  }
363 
366  [XmlIgnore]
368  {
369  get
370  {
371  return notations;
372  }
373  }
374 
375  [XmlIgnore]
376  internal XmlSchemaObjectTable IdentityConstraints
377  {
378  get
379  {
380  return identityConstraints;
381  }
382  }
383 
384  [XmlIgnore]
385  internal Uri BaseUri
386  {
387  get
388  {
389  return baseUri;
390  }
391  set
392  {
393  baseUri = value;
394  }
395  }
396 
397  [XmlIgnore]
398  internal int SchemaId
399  {
400  get
401  {
402  if (schemaId == -1)
403  {
404  schemaId = Interlocked.Increment(ref globalIdCounter);
405  }
406  return schemaId;
407  }
408  }
409 
410  [XmlIgnore]
411  internal bool IsChameleon
412  {
413  get
414  {
415  return isChameleon;
416  }
417  set
418  {
419  isChameleon = value;
420  }
421  }
422 
423  [XmlIgnore]
424  internal Hashtable Ids
425  {
426  get
427  {
428  return ids;
429  }
430  }
431 
432  [XmlIgnore]
433  internal XmlDocument Document
434  {
435  get
436  {
437  if (document == null)
438  {
439  document = new XmlDocument();
440  }
441  return document;
442  }
443  }
444 
445  [XmlIgnore]
446  internal int ErrorCount
447  {
448  get
449  {
450  return errorCount;
451  }
452  set
453  {
454  errorCount = value;
455  }
456  }
457 
458  [XmlIgnore]
459  internal override string IdAttribute
460  {
461  get
462  {
463  return Id;
464  }
465  set
466  {
467  Id = value;
468  }
469  }
470 
471  internal XmlNameTable NameTable
472  {
473  get
474  {
475  if (nameTable == null)
476  {
477  nameTable = new NameTable();
478  }
479  return nameTable;
480  }
481  }
482 
483  internal ArrayList ImportedSchemas
484  {
485  get
486  {
487  if (importedSchemas == null)
488  {
489  importedSchemas = new ArrayList();
490  }
491  return importedSchemas;
492  }
493  }
494 
495  internal ArrayList ImportedNamespaces
496  {
497  get
498  {
499  if (importedNamespaces == null)
500  {
501  importedNamespaces = new ArrayList();
502  }
503  return importedNamespaces;
504  }
505  }
506 
512  public static XmlSchema Read(TextReader reader, ValidationEventHandler validationEventHandler)
513  {
514  return Read(new XmlTextReader(reader), validationEventHandler);
515  }
516 
522  public static XmlSchema Read(Stream stream, ValidationEventHandler validationEventHandler)
523  {
524  return Read(new XmlTextReader(stream), validationEventHandler);
525  }
526 
532  public static XmlSchema Read(XmlReader reader, ValidationEventHandler validationEventHandler)
533  {
534  XmlNameTable xmlNameTable = reader.NameTable;
535  Parser parser = new Parser(SchemaType.XSD, xmlNameTable, new SchemaNames(xmlNameTable), validationEventHandler);
536  try
537  {
538  parser.Parse(reader, null);
539  }
540  catch (XmlSchemaException ex)
541  {
542  if (validationEventHandler == null)
543  {
544  throw ex;
545  }
546  validationEventHandler(null, new ValidationEventArgs(ex));
547  return null;
548  }
549  return parser.XmlSchema;
550  }
551 
554  public void Write(Stream stream)
555  {
556  Write(stream, null);
557  }
558 
562  public void Write(Stream stream, XmlNamespaceManager namespaceManager)
563  {
564  XmlTextWriter xmlTextWriter = new XmlTextWriter(stream, null);
565  xmlTextWriter.Formatting = Formatting.Indented;
566  Write(xmlTextWriter, namespaceManager);
567  }
568 
571  public void Write(TextWriter writer)
572  {
573  Write(writer, null);
574  }
575 
579  public void Write(TextWriter writer, XmlNamespaceManager namespaceManager)
580  {
581  XmlTextWriter xmlTextWriter = new XmlTextWriter(writer);
582  xmlTextWriter.Formatting = Formatting.Indented;
583  Write(xmlTextWriter, namespaceManager);
584  }
585 
589  public void Write(XmlWriter writer)
590  {
591  Write(writer, null);
592  }
593 
597  public void Write(XmlWriter writer, XmlNamespaceManager namespaceManager)
598  {
599  XmlSerializer xmlSerializer = new XmlSerializer(typeof(XmlSchema));
600  XmlSerializerNamespaces xmlSerializerNamespaces;
601  if (namespaceManager != null)
602  {
603  xmlSerializerNamespaces = new XmlSerializerNamespaces();
604  bool flag = false;
605  if (base.Namespaces != null)
606  {
607  flag = (base.Namespaces.Namespaces["xs"] != null || base.Namespaces.Namespaces.ContainsValue("http://www.w3.org/2001/XMLSchema"));
608  }
609  if (!flag && namespaceManager.LookupPrefix("http://www.w3.org/2001/XMLSchema") == null && namespaceManager.LookupNamespace("xs") == null)
610  {
611  xmlSerializerNamespaces.Add("xs", "http://www.w3.org/2001/XMLSchema");
612  }
613  foreach (string item in namespaceManager)
614  {
615  if (item != "xml" && item != "xmlns")
616  {
617  xmlSerializerNamespaces.Add(item, namespaceManager.LookupNamespace(item));
618  }
619  }
620  }
621  else if (base.Namespaces != null && base.Namespaces.Count > 0)
622  {
623  Hashtable namespaces = base.Namespaces.Namespaces;
624  if (namespaces["xs"] == null && !namespaces.ContainsValue("http://www.w3.org/2001/XMLSchema"))
625  {
626  namespaces.Add("xs", "http://www.w3.org/2001/XMLSchema");
627  }
628  xmlSerializerNamespaces = base.Namespaces;
629  }
630  else
631  {
632  xmlSerializerNamespaces = new XmlSerializerNamespaces();
633  xmlSerializerNamespaces.Add("xs", "http://www.w3.org/2001/XMLSchema");
634  if (targetNs != null && targetNs.Length != 0)
635  {
636  xmlSerializerNamespaces.Add("tns", targetNs);
637  }
638  }
639  xmlSerializer.Serialize(writer, this, xmlSerializerNamespaces);
640  }
641 
644  [Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. http://go.microsoft.com/fwlink/?linkid=14202")]
645  public void Compile(ValidationEventHandler validationEventHandler)
646  {
647  SchemaInfo schemaInfo = new SchemaInfo();
648  schemaInfo.SchemaType = SchemaType.XSD;
649  CompileSchema(null, XmlReaderSection.CreateDefaultResolver(), schemaInfo, null, validationEventHandler, NameTable, CompileContentModel: false);
650  }
651 
655  [Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. http://go.microsoft.com/fwlink/?linkid=14202")]
656  public void Compile(ValidationEventHandler validationEventHandler, XmlResolver resolver)
657  {
658  SchemaInfo schemaInfo = new SchemaInfo();
659  schemaInfo.SchemaType = SchemaType.XSD;
660  CompileSchema(null, resolver, schemaInfo, null, validationEventHandler, NameTable, CompileContentModel: false);
661  }
662 
663  internal bool CompileSchema(XmlSchemaCollection xsc, XmlResolver resolver, SchemaInfo schemaInfo, string ns, ValidationEventHandler validationEventHandler, XmlNameTable nameTable, bool CompileContentModel)
664  {
665  lock (this)
666  {
667  SchemaCollectionPreprocessor schemaCollectionPreprocessor = new SchemaCollectionPreprocessor(nameTable, null, validationEventHandler);
668  schemaCollectionPreprocessor.XmlResolver = resolver;
669  if (!schemaCollectionPreprocessor.Execute(this, ns, loadExternals: true, xsc))
670  {
671  return false;
672  }
673  SchemaCollectionCompiler schemaCollectionCompiler = new SchemaCollectionCompiler(nameTable, validationEventHandler);
674  isCompiled = schemaCollectionCompiler.Execute(this, schemaInfo, CompileContentModel);
675  SetIsCompiled(isCompiled);
676  return isCompiled;
677  }
678  }
679 
680  internal void CompileSchemaInSet(XmlNameTable nameTable, ValidationEventHandler eventHandler, XmlSchemaCompilationSettings compilationSettings)
681  {
682  Compiler compiler = new Compiler(nameTable, eventHandler, null, compilationSettings);
683  compiler.Prepare(this, cleanup: true);
684  isCompiledBySet = compiler.Compile();
685  }
686 
687  internal new XmlSchema Clone()
688  {
689  XmlSchema xmlSchema = new XmlSchema();
690  xmlSchema.attributeFormDefault = attributeFormDefault;
691  xmlSchema.elementFormDefault = elementFormDefault;
692  xmlSchema.blockDefault = blockDefault;
693  xmlSchema.finalDefault = finalDefault;
694  xmlSchema.targetNs = targetNs;
695  xmlSchema.version = version;
696  xmlSchema.includes = includes;
697  xmlSchema.Namespaces = base.Namespaces;
698  xmlSchema.items = items;
699  xmlSchema.BaseUri = BaseUri;
700  SchemaCollectionCompiler.Cleanup(xmlSchema);
701  return xmlSchema;
702  }
703 
704  internal XmlSchema DeepClone()
705  {
706  XmlSchema xmlSchema = new XmlSchema();
707  xmlSchema.attributeFormDefault = attributeFormDefault;
708  xmlSchema.elementFormDefault = elementFormDefault;
709  xmlSchema.blockDefault = blockDefault;
710  xmlSchema.finalDefault = finalDefault;
711  xmlSchema.targetNs = targetNs;
712  xmlSchema.version = version;
713  xmlSchema.isPreprocessed = isPreprocessed;
714  for (int i = 0; i < items.Count; i++)
715  {
716  XmlSchemaComplexType xmlSchemaComplexType;
717  XmlSchemaElement xmlSchemaElement;
718  XmlSchemaGroup xmlSchemaGroup;
719  XmlSchemaObject item = ((xmlSchemaComplexType = (items[i] as XmlSchemaComplexType)) == null) ? (((xmlSchemaElement = (items[i] as XmlSchemaElement)) == null) ? (((xmlSchemaGroup = (items[i] as XmlSchemaGroup)) == null) ? items[i].Clone() : xmlSchemaGroup.Clone(this)) : xmlSchemaElement.Clone(this)) : xmlSchemaComplexType.Clone(this);
720  xmlSchema.Items.Add(item);
721  }
722  for (int j = 0; j < includes.Count; j++)
723  {
724  XmlSchemaExternal item2 = (XmlSchemaExternal)includes[j].Clone();
725  xmlSchema.Includes.Add(item2);
726  }
727  xmlSchema.Namespaces = base.Namespaces;
728  xmlSchema.BaseUri = BaseUri;
729  return xmlSchema;
730  }
731 
732  internal void SetIsCompiled(bool isCompiled)
733  {
734  this.isCompiled = isCompiled;
735  }
736 
737  internal override void SetUnhandledAttributes(XmlAttribute[] moreAttributes)
738  {
739  this.moreAttributes = moreAttributes;
740  }
741 
742  internal override void AddAnnotation(XmlSchemaAnnotation annotation)
743  {
744  items.Add(annotation);
745  }
746 
747  internal void GetExternalSchemasList(IList extList, XmlSchema schema)
748  {
749  if (extList.Contains(schema))
750  {
751  return;
752  }
753  extList.Add(schema);
754  for (int i = 0; i < schema.Includes.Count; i++)
755  {
756  XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal)schema.Includes[i];
757  if (xmlSchemaExternal.Schema != null)
758  {
759  GetExternalSchemasList(extList, xmlSchemaExternal.Schema);
760  }
761  }
762  }
763  }
764 }
Represents an XML document. You can use this class to load, validate, edit, add, and position XML in ...
Definition: XmlDocument.cs:13
Contains the XML namespaces and prefixes that the T:System.Xml.Serialization.XmlSerializer uses to ge...
void Write(XmlWriter writer, XmlNamespaceManager namespaceManager)
Writes the XML Schema to the supplied T:System.Xml.XmlWriter.
Definition: XmlSchema.cs:597
virtual void Add(object key, object value)
Adds an element with the specified key and value into the T:System.Collections.Hashtable.
Definition: Hashtable.cs:916
void Write(Stream stream, XmlNamespaceManager namespaceManager)
Writes the XML Schema to the supplied T:System.IO.Stream using the T:System.Xml.XmlNamespaceManager s...
Definition: XmlSchema.cs:562
XmlSchemaObjectTable Groups
Gets the post-schema-compilation value of all the groups in the schema.
Definition: XmlSchema.cs:357
XmlSchemaDerivationMethod BlockDefault
Gets or sets the blockDefault attribute which sets the default value of the block attribute on elemen...
Definition: XmlSchema.cs:104
void Add(string prefix, string ns)
Adds a prefix and namespace pair to an T:System.Xml.Serialization.XmlSerializerNamespaces object.
Represents the attributeGroup element from the XML Schema as specified by the World Wide Web Consorti...
XmlSchemaObjectCollection Items
Gets the collection of schema elements in the schema and is used to add new element types at the sche...
Definition: XmlSchema.cs:201
string TargetNamespace
Gets or sets the Uniform Resource Identifier (URI) of the schema target namespace.
Definition: XmlSchema.cs:151
Represents a non-generic collection of objects that can be individually accessed by index.
Definition: IList.cs:8
XmlSchemaForm
Indicates if attributes or elements need to be qualified with a namespace prefix.
Definition: XmlSchemaForm.cs:7
A collection of T:System.Xml.Schema.XmlSchemaObjects.
Definition: __Canon.cs:3
Represents the root class for the Xml schema object model hierarchy and serves as a base class for cl...
XmlSchemaObjectTable Elements
Gets the post-schema-compilation value for all the elements in the schema.
Definition: XmlSchema.cs:312
Resolves external XML resources named by a Uniform Resource Identifier (URI).
Definition: XmlResolver.cs:8
Represents an attribute. Valid and default values for the attribute are defined in a document type de...
Definition: XmlAttribute.cs:7
bool IsCompiled
Indicates if the schema has been compiled.
Definition: XmlSchema.cs:213
Represents the include element from XML Schema as specified by the World Wide Web Consortium (W3C)....
void Compile(ValidationEventHandler validationEventHandler, XmlResolver resolver)
Compiles the XML Schema Object Model (SOM) into schema information for validation....
Definition: XmlSchema.cs:656
Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files t...
Definition: XmlWriter.cs:12
Represents a reader that provides fast, non-cached, forward-only access to XML data....
XmlSchemaObjectCollection Includes
Gets the collection of included and imported schemas.
Definition: XmlSchema.cs:183
Represents a reader that provides fast, noncached, forward-only access to XML data....
Definition: XmlReader.cs:15
XmlSchemaObjectTable Attributes
Gets the post-schema-compilation value for all the attributes in the schema.
Definition: XmlSchema.cs:267
static XmlSchema Read(TextReader reader, ValidationEventHandler validationEventHandler)
Reads an XML Schema from the supplied T:System.IO.TextReader.
Definition: XmlSchema.cs:512
XmlSchemaObjectTable AttributeGroups
Gets the post-schema-compilation value of all the global attribute groups in the schema.
Definition: XmlSchema.cs:282
Implements a single-threaded T:System.Xml.XmlNameTable.
Definition: NameTable.cs:5
Represents the group element from XML Schema as specified by the World Wide Web Consortium (W3C)....
Represents the notation element from XML Schema as specified by the World Wide Web Consortium (W3C)....
delegate void ValidationEventHandler(object sender, ValidationEventArgs e)
Represents the callback method that will handle XML schema validation events and the T:System....
int Add(XmlSchemaObject item)
Adds an T:System.Xml.Schema.XmlSchemaObject to the XmlSchemaObjectCollection.
Represents a collection of key/value pairs that are organized based on the hash code of the key....
Definition: Hashtable.cs:17
Represents the import element from XML Schema as specified by the World Wide Web Consortium (W3C)....
void Compile(ValidationEventHandler validationEventHandler)
Compiles the XML Schema Object Model (SOM) into schema information for validation....
Definition: XmlSchema.cs:645
Represents a writer that provides a fast, non-cached, forward-only way of generating streams or files...
Resolves, adds, and removes namespaces to a collection and provides scope management for these namesp...
virtual string LookupPrefix(string uri)
Finds the prefix declared for the given namespace URI.
Represents the complexType element from XML Schema as specified by the World Wide Web Consortium (W3C...
Represents a writer that can write a sequential series of characters. This class is abstract.
Definition: TextWriter.cs:15
static int Increment(ref int location)
Increments a specified variable and stores the result, as an atomic operation.
Definition: Interlocked.cs:18
Serializes and deserializes objects into and from XML documents. The T:System.Xml....
Provides the collections for contained elements in the T:System.Xml.Schema.XmlSchema class (for examp...
static XmlSchema Read(Stream stream, ValidationEventHandler validationEventHandler)
Reads an XML Schema from the supplied stream.
Definition: XmlSchema.cs:522
XmlSchemaForm ElementFormDefault
Gets or sets the form for elements declared in the target namespace of the schema.
Definition: XmlSchema.cs:136
Represents an element.
Definition: XmlElement.cs:7
Represents the version number of an assembly, operating system, or the common language runtime....
Definition: Version.cs:11
int Add(object value)
Adds an item to the T:System.Collections.IList.
Table of atomized string objects.
Definition: XmlNameTable.cs:5
const string InstanceNamespace
The XML schema instance namespace. This field is constant.
Definition: XmlSchema.cs:19
virtual bool ContainsValue(object value)
Determines whether the T:System.Collections.Hashtable contains a specific value.
Definition: Hashtable.cs:1017
const string Namespace
The XML schema namespace. This field is constant.
Definition: XmlSchema.cs:16
XmlSchemaForm AttributeFormDefault
Gets or sets the form for attributes declared in the target namespace of the schema.
Definition: XmlSchema.cs:88
void Write(TextWriter writer, XmlNamespaceManager namespaceManager)
Writes the XML Schema to the supplied T:System.IO.TextWriter.
Definition: XmlSchema.cs:579
Formatting Formatting
Indicates how the output is formatted.
XmlSchemaObjectTable Notations
Gets the post-schema-compilation value for all notations in the schema.
Definition: XmlSchema.cs:368
void Write(XmlWriter writer)
Writes the XML Schema to the supplied T:System.Xml.XmlWriter.
Definition: XmlSchema.cs:589
int Count
Gets the number of elements contained in the T:System.Collections.CollectionBase instance....
Represents the element element from XML Schema as specified by the World Wide Web Consortium (W3C)....
XmlSchemaObjectTable SchemaTypes
Gets the post-schema-compilation value of all schema types in the schema.
Definition: XmlSchema.cs:297
Represents a reader that can read a sequential series of characters.
Definition: TextReader.cs:14
An in-memory representation of an XML Schema, as specified in the World Wide Web Consortium (W3C) XML...
Definition: XmlSchema.cs:13
XmlSchemaDerivationMethod FinalDefault
Gets or sets the finalDefault attribute which sets the default value of the final attribute on elemen...
Definition: XmlSchema.cs:120
void Write(Stream stream)
Writes the XML Schema to the supplied data stream.
Definition: XmlSchema.cs:554
Formatting
Specifies formatting options for the T:System.Xml.XmlTextWriter.
Definition: Formatting.cs:4
XmlAttribute [] UnhandledAttributes
Gets and sets the qualified attributes which do not belong to the schema target namespace.
Definition: XmlSchema.cs:342
virtual string LookupNamespace(string prefix)
Gets the namespace URI for the specified prefix.
bool Contains(object value)
Determines whether the T:System.Collections.IList contains a specific value.
static XmlSchema Read(XmlReader reader, ValidationEventHandler validationEventHandler)
Reads an XML Schema from the supplied T:System.Xml.XmlReader.
Definition: XmlSchema.cs:532
void Serialize(TextWriter textWriter, object o)
Serializes the specified T:System.Object and writes the XML document to a file using the specified T:...
Represents the World Wide Web Consortium (W3C) annotation element.
Returns detailed information about the schema exception.
Provides an object representation of a uniform resource identifier (URI) and easy access to the parts...
Definition: Uri.cs:19
void Write(TextWriter writer)
Writes the XML Schema to the supplied T:System.IO.TextWriter.
Definition: XmlSchema.cs:571
XmlSchemaDerivationMethod
Provides different methods for preventing derivation.
Represents the simpleType element for simple content from XML Schema as specified by the World Wide W...
Represents the redefine element from XML Schema as specified by the World Wide Web Consortium (W3C)....
Provides atomic operations for variables that are shared by multiple threads.
Definition: Interlocked.cs:10
Returns detailed information related to the ValidationEventHandler.
Represents the attribute element from the XML Schema as specified by the World Wide Web Consortium (W...
string Id
Gets or sets the string ID.
Definition: XmlSchema.cs:327
Represents an XML reader section.
abstract XmlNameTable NameTable
When overridden in a derived class, gets the T:System.Xml.XmlNameTable associated with this implement...
Definition: XmlReader.cs:373
Implements the T:System.Collections.IList interface using an array whose size is dynamically increase...
Definition: ArrayList.cs:14
Contains a cache of XML Schema definition language (XSD) and XML-Data Reduced (XDR) schemas....
Provides a generic view of a sequence of bytes. This is an abstract class.To browse the ....
Definition: Stream.cs:16