diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2003-07-12 11:39:25 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2003-07-12 11:39:25 +0400 |
commit | 86b8448fdb822ca1f72a61c85b1dbe2ae05f8527 (patch) | |
tree | fb963987fe9284b7948f25c80ff9f77834b8e918 /mcs/class/System.XML/System.Xml/DTDObjectModel.cs | |
parent | aececc6f872ed754acca6f96483123ce00827400 (diff) |
2003-07-12 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
* XmlAttribute.cs,
XmlElement.cs : Fixed CloneNode() for bug #46129.
* XmlDocument.cs : Fixed MakeReaderErrorMessage that specified invalid
String.Format arguments, and basically XmlException.ctor(
IXmlLineInfo, message) seems good idea to use.
* XmlTextReader.cs :
- Fixed .ctor(Stream, XmlNodeType, XmlParserContext) which had
required non-null context which don't have to exist.
- Added state check. Introduced 'currentState' and 'maybeTextDecl'
(for external entity) and removed hasEnteredDocument. Added
state-check logic to ReadStartTag(), ReadEndTag(), ReadText(),
ReadCData(), ReadDoctypeDecl() and ReadWhitespace().
- Replaced throw ReaderError() with throw new XmlException() and
fixed that some error hadn't thrown, only created.
- ResetState() should re-initialize existing private members other
than some specified fields.
- Private AddAttribute() should check if the same-named attribute
already exists.
* DTDObjectModel.cs : Additive declaration for ATTLIST is availabe now.
svn path=/trunk/mcs/; revision=16131
Diffstat (limited to 'mcs/class/System.XML/System.Xml/DTDObjectModel.cs')
-rw-r--r-- | mcs/class/System.XML/System.Xml/DTDObjectModel.cs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs index 23267400737..187350f3f2a 100644 --- a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs +++ b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs @@ -147,12 +147,20 @@ namespace Mono.Xml public void Add (string name, DTDAttListDeclaration decl) { - if (attListDecls [name] != null) - throw new InvalidOperationException (String.Format ( - "AttList declaration for {0} was already added.", - name)); - decl.SetRoot (root); - attListDecls.Add (name, decl); + DTDAttListDeclaration existing = this [name]; + if (existing != null) { + // It should be valid and + // has effect of additive declaration. +// throw new InvalidOperationException (String.Format ( +// "AttList declaration for {0} was already added.", +// name)); + foreach (DTDAttributeDefinition def in decl.Definitions) + if (decl.Get (def.Name) == null) + existing.Add (def); + } else { + decl.SetRoot (root); + attListDecls.Add (name, decl); + } } public ICollection Keys { |