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
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')
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog7
-rw-r--r--mcs/class/System.XML/System.Xml/DTDObjectModel.cs38
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextReader.cs1
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextReader2.cs2
4 files changed, 44 insertions, 4 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
index 94522d42ece..c4d1f01a753 100644
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ b/mcs/class/System.XML/System.Xml/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-15 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DTDObjectModel.cs : some fixes on GetXmlSchema()
+ - make generated schema cleaner.
+ - enumeration was missing for attribute type.
+ * XmlTextReader.cs, XmlTextReader2.cs : added tiny notes for dtd2xsd.
+
2005-12-15 Konstantin Triger <kostat@mainsoft.com>
* XmlTextWriter.cs: allow null string in WriteCData.
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;
diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader.cs b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
index dc04ba5ad8c..24ea805b176 100644
--- a/mcs/class/System.XML/System.Xml/XmlTextReader.cs
+++ b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
@@ -695,6 +695,7 @@ namespace System.Xml
#region Internals
// Parsed DTD Objects
+ // Note that thgis property must be kept since dtd2xsd uses it.
internal DTDObjectModel DTD {
get { return parserContext.Dtd; }
}
diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader2.cs b/mcs/class/System.XML/System.Xml/XmlTextReader2.cs
index 31d0f49eb51..da97c7c377f 100644
--- a/mcs/class/System.XML/System.Xml/XmlTextReader2.cs
+++ b/mcs/class/System.XML/System.Xml/XmlTextReader2.cs
@@ -45,7 +45,7 @@ namespace System.Xml
IXmlLineInfo, IXmlNamespaceResolver, IHasXmlParserContext
{
XmlTextReader entity;
- XmlTextReaderImpl source;
+ XmlTextReaderImpl source; // dtd2xsd expects this field's existence.
bool entityInsideAttribute;
bool insideAttribute;