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-12-15 17:40:17 +0300
committerAtsushi Eno <atsushieno@gmail.com>2005-12-15 17:40:17 +0300
commit775f8f8bd720c5ad61a0236d63bf602ecec9dc5f (patch)
tree54e29a033650c4df595506de41027c1da4f6b492 /mcs/class/System.XML/System.Xml/DTDObjectModel.cs
parent3eaa34c14317cad461bac21168156b2bb8ea0fdb (diff)
2005-10-05 Atsushi Enomoto <atsushi@ximian.com>
* System.Configuration.dll.sources: added IntegerValidatorAttribute.cs, IntegerValidator.cs, LongValidator.cs and LongValidatorAttribute.cs. * IntegerValidatorAttribute.cs, IntegerValidator.cs, LongValidator.cs, LongValidatorAttribute.cs : new files. svn path=/trunk/mcs/; revision=54458
Diffstat (limited to 'mcs/class/System.XML/System.Xml/DTDObjectModel.cs')
-rw-r--r--mcs/class/System.XML/System.Xml/DTDObjectModel.cs38
1 files changed, 35 insertions, 3 deletions
diff --git a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
index 5cbebbd8913..715f4596651 100644
--- a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
+++ b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
@@ -445,15 +445,21 @@ namespace Mono.Xml
SetLineInfo (el);
el.RefName = new XmlQualifiedName (ElementName);
return el;
- } else {
+ }
+ else if (ChildModels.Count == 0)
+ return null;
+ else {
XmlSchemaGroupBase gb =
(OrderType == DTDContentOrderType.Seq) ?
(XmlSchemaGroupBase)
new XmlSchemaSequence () :
new XmlSchemaChoice ();
SetLineInfo (gb);
- foreach (DTDContentModel cm in ChildModels.Items)
- gb.Items.Add (cm.CreateXsdParticle ());
+ foreach (DTDContentModel cm in ChildModels.Items) {
+ XmlSchemaParticle c = cm.CreateXsdParticle ();
+ if (c != null)
+ gb.Items.Add (c);
+ }
p = gb;
}
switch (Occurence) {
@@ -673,6 +679,30 @@ namespace Mono.Xml
XmlSchemaElement el = new XmlSchemaElement ();
SetLineInfo (el);
el.Name = Name;
+
+ XmlSchemaComplexType ct = new XmlSchemaComplexType ();
+ el.SchemaType = ct;
+ if (Attributes != null) {
+ SetLineInfo (ct);
+ foreach (DTDAttributeDefinition a in
+ Attributes.Definitions)
+ ct.Attributes.Add (a.CreateXsdAttribute ());
+ }
+ if (IsEmpty)
+ ; // nothing to do
+ else if (IsAny) {
+ XmlSchemaAny any = new XmlSchemaAny ();
+ any.MinOccurs = 0;
+ any.MaxOccursString = "unbounded";
+ ct.Particle = any;
+ }
+ else {
+ if (IsMixedContent)
+ ct.IsMixed = true;
+ ct.Particle = ContentModel.CreateXsdParticle ();
+ }
+
+ /*
if (IsEmpty) {
el.SchemaType = new XmlSchemaComplexType ();
SetLineInfo (el.SchemaType);
@@ -692,6 +722,7 @@ namespace Mono.Xml
ct.Particle = ContentModel.CreateXsdParticle ();
el.SchemaType = ct;
}
+ */
return el;
}
}
@@ -839,6 +870,7 @@ namespace Mono.Xml
f.Value = name;
}
}
+ st.Content = r;
}
else if (qname != XmlQualifiedName.Empty)
a.SchemaTypeName = qname;