Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2005-05-21 14:55:29 +0400
committerAtsushi Eno <atsushieno@gmail.com>2005-05-21 14:55:29 +0400
commitccf422ff07f9660345f8668617fffa1227e19f26 (patch)
tree4edf131329953e8b0e56156f4f7a5e92035b9781 /mcs/class/System.XML/System.Xml/DTDObjectModel.cs
parent7a340a00836233537d711d9ec7ba933dcdcdd4ea (diff)
2005-05-21 Atsushi Enomoto <atsushi@ximian.com>
* DTDObjectModel.cs : For simple type restriction creation it failed when there is no enumerations (largely failed). svn path=/trunk/mcs/; revision=44868
Diffstat (limited to 'mcs/class/System.XML/System.Xml/DTDObjectModel.cs')
-rw-r--r--mcs/class/System.XML/System.Xml/DTDObjectModel.cs21
1 files changed, 12 insertions, 9 deletions
diff --git a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
index 35f1dc0b71b..42fcdcf5815 100644
--- a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
+++ b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
@@ -683,9 +683,10 @@ namespace Mono.Xml
else {
XmlSchemaComplexType ct = new XmlSchemaComplexType ();
SetLineInfo (ct);
- foreach (DTDAttributeDefinition a in
- Attributes.Definitions)
- ct.Attributes.Add (a.CreateXsdAttribute ());
+ if (Attributes != null)
+ foreach (DTDAttributeDefinition a in
+ Attributes.Definitions)
+ ct.Attributes.Add (a.CreateXsdAttribute ());
if (IsMixedContent)
ct.IsMixed = true;
ct.Particle = ContentModel.CreateXsdParticle ();
@@ -829,12 +830,14 @@ namespace Mono.Xml
new XmlSchemaSimpleTypeRestriction ();
SetLineInfo (r);
r.BaseTypeName = qname;
- foreach (string name in enumeratedNotations) {
- XmlSchemaEnumerationFacet f =
- new XmlSchemaEnumerationFacet ();
- SetLineInfo (f);
- r.Facets.Add (f);
- f.Value = name;
+ if (enumeratedNotations != null) {
+ foreach (string name in enumeratedNotations) {
+ XmlSchemaEnumerationFacet f =
+ new XmlSchemaEnumerationFacet ();
+ SetLineInfo (f);
+ r.Facets.Add (f);
+ f.Value = name;
+ }
}
}
else if (qname != XmlQualifiedName.Empty)