Files
mono/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectTable.cs
T
Atsushi Eno ccd5f38514 2004-01-21 Atsushi Enomoto <[email protected]>
* XmlSchema.cs :
	  - Removed extra property Language.  Fill substitution-group info
	    before ContentTypeParticle is computed.
	* XmlSchemaComplexType.cs : ContentType and ContentTypeParticle are
	  now computer before Validate() (to exclude 3.4.2 from 3.4.6
	  component constraint check).
	* XmlSchemaObject.cs, XmlSchemaParticle.cs :
	  Added CopyInfo() for cloning objects.
	* XmlSchemaObjectTable.cs :
	  Add() doesn't have to reject same named items.
	* XmlSchemaParticle.cs :
	  - Renamed internal class XmlSchemaParticleEmpty to EmptyParticle
	    (for ease of post compilation infoset comparison).
	  - GetMinEffectiveTotalRange() should return max occurs for element and
	    any.
	* XmlSchemaParticle.cs,
	  XmlSchemaAll.cs,
	  XmlSchemaAny.cs,
	  XmlSchemaChoice.cs,
	  XmlSchemaElement.cs,
	  XmlSchemaGroupBase.cs,
	  XmlSchemaGroupRef.cs,
	  XmlSchemaSequence.cs :
	  - Removed ActualParticle property.
	  - Added GetOptimizedParticle() to get ContentTypeParticle.
	  - ContentTypeParticle is now created as different object from
	    user-specified "Particle" property.
	  - Return Empty particle when model groups contains no Items.
	  - When Items contains exactly 1 item, return the item (unless it is
	    top level choice model group - it causes DBR problem).
	  - ValidateDerivationValidRestriction() and related WXS 3.9.6 DBR
	    check methods such as ValidateNSRecurseCheckCardinality() now
	    returns a bool value and avoids exceptions on each failure time.
	  - ValidateRecurse() now doesn't progress base particle incorrectly.
	    (it caused incorrect order-preserving-mapping error.)
	  - 3.9.6 Recurse, RecurseLax, MapAndSum are now treated as different.
	* XmlSchemaAll.cs : occurence validation shoud be done against values
	  after computation (ValidatedMaxOccurs).
	* XmlSchemaChoice.cs : When Items is empty, then invoke warning event.
	* XmlSchemaElement.cs :
	  - Consider referencedElement also for SubstitutionGroupElement.
	  - Removed SubstitutingChoice which is not in use.
	  - when it was targeted as substitution group by other elements, its
	    ContentTypeParticle should be substitution choice (see 3.9.6
	    Particle Valid (Restriction) term 2.1).
	  - Added FillsubstitutionElementInfo() (see XmlSchema.cs above).
	* XmlSchemaGroup.cs : Removed extra check on model group (because it
	  is impossible to specify non-model-group particle).
	* XmlSchemaIdentityConstraint.cs,
	  XmlSchemaKey.cs,
	  XmlSchemaKeyRef.cs,
	  XmlSchemaUnique.cs : Removed extraneous MonoTODO.
	* XmlSchemaSimpleContent.cs : Made actualSchemaType as internal.
	* XmlSchemaSimpleType.cs : Removed extraneous new Datatype property.
	* XmlSchemaSimpleTypeRestriction.cs : Renamed actualBaseSchemaType to
	  ActualBaseSchemaType.
	* XmlSchemaSimpleTypeList.cs, XmlSchemaSimpleTypeUnion.cs :
	  Removed unused actualBaseSchemaType code.
	* XmlSchemaType.cs : use recently introduced BaseXmlSchemaType.
	* XmlSchemaUtil.cs : Removed unused CheckLanguage().

svn path=/trunk/mcs/; revision=22323
2004-01-21 08:06:51 +00:00

118 lines
2.5 KiB
C#
Executable File

// Author: Dwivedi, Ajay kumar
// [email protected]
using System;
using System.Collections;
using System.Xml;
namespace System.Xml.Schema
{
/// <summary>
/// Summary description for XmlSchemaObjectTable.
/// </summary>
public class XmlSchemaObjectTable
{
private Hashtable table;
internal XmlSchemaObjectTable ()
{
table = new Hashtable();
}
public int Count
{
get{ return table.Count; }
}
public XmlSchemaObject this [XmlQualifiedName name]
{
get{ return (XmlSchemaObject) table [name]; }
}
public ICollection Names
{
get{ return table.Keys; }
}
public ICollection Values
{
get{ return table.Values; }
}
public bool Contains (XmlQualifiedName name)
{
return table.Contains (name);
}
public IDictionaryEnumerator GetEnumerator ()
{
return new XmlSchemaObjectTableEnumerator (this);
}
internal void Add (XmlQualifiedName name, XmlSchemaObject value)
{
table [name] = value;
}
internal void Clear ()
{
table.Clear ();
}
internal void Set (XmlQualifiedName name, XmlSchemaObject value)
{
table [name] = value;
}
internal class XmlSchemaObjectTableEnumerator : IDictionaryEnumerator
{
private IDictionaryEnumerator xenum;
IEnumerable tmp;
XmlSchemaObjectTable table;
internal XmlSchemaObjectTableEnumerator (XmlSchemaObjectTable table)
{
this.table = table;
tmp = (IEnumerable) table.table;
xenum = (IDictionaryEnumerator) tmp.GetEnumerator ();
}
// Properties
public XmlSchemaObject Current {
get {
return (XmlSchemaObject) xenum.Value;
}
}
public DictionaryEntry Entry {
get { return xenum.Entry; }
}
public XmlQualifiedName Key {
get { return (XmlQualifiedName) xenum.Key; }
}
public XmlSchemaObject Value {
get { return (XmlSchemaObject) xenum.Value; }
}
// Methods
public bool MoveNext()
{
return xenum.MoveNext();
}
//Explicit Interface implementation
bool IEnumerator.MoveNext()
{
return xenum.MoveNext();
}
void IEnumerator.Reset()
{
xenum.Reset();
}
object IEnumerator.Current
{
get { return xenum.Entry; }
}
DictionaryEntry IDictionaryEnumerator.Entry {
get { return xenum.Entry; }
}
object IDictionaryEnumerator.Key {
get { return (XmlQualifiedName) xenum.Key; }
}
object IDictionaryEnumerator.Value {
get { return (XmlSchemaObject) xenum.Value; }
}
}
}
}