* XmlAttributeCollection.cs : removed duplicate ID attribute check
here as this behavior not specifically defined by W3C DOM Level 2
specification. Fixed bug #508296.
* XmlAttributeCollectionTests.cs : add test for bug #508296 by
Tom Hindle.
svn path=/trunk/mcs/; revision=141952
* XmlAttributeCollection.cs : when the node to be inserted has owner
element _but_ is identical to that of this collection, do not
reject it to raise an error. Fixed bug #496022.
* XmlAttributeCollectionTests.cs : added test for bug #496022.
svn path=/trunk/mcs/; revision=132344
* XmlAttributeCollection.cs : check attribute identity only if the
source node is in the document tree. Fixed bug #380720.
* XmlElementTests.cs : added test for bug #380720.
* XmlAttributeTests.cs : numbered some assertions.
svn path=/trunk/mcs/; revision=101019
* XmlAttributeCollection.cs :
Replaced all Nodes.Count with Count (it could avoid extraneous
ArrayList creation in XmlNamedNodeMap). ID attribute adjustment
was extraneously done against all attribute nodes and thus there
was a plenty of call to Value.
* XmlNamedNodeMap.cs : added comment on SetNamedItem() W3C spec
violation.
svn path=/trunk/mcs/; revision=56152
* XmlNode.cs,
XmlAttribute.cs,
XmlAttributeCollection.cs :
Now reuse parentNode field for XmlAttribute.OwnerElement and
reduce class allocation size.
* XmlNameEntry.cs :
New class that represents a name triplet.
XmlNameEntryCache.cs :
New type to cache name entries.
* XmlAttribute.cs,
XmlElement.cs :
Replace name strings with name entry and save class allocation size.
XmlDocument.cs :
Add name entry cache field to document and reuse name entries that
are already allocated.
svn path=/trunk/mcs/; revision=39086
* XmlAttributeCollection.cs : In .net 2.0, it became sealed class.
* IXmlDataEvidence.cs : not "Evidences" but "Evidence".
* XmlInputStream.cs : new csc rejected implicit int->char cast.
* XmlNamespaceManager.cs : In net_2_0, LookupNamespace(string) and
LookupPrefix(string) does not require argument string as atomized.
Added HasNamespace (string, bool).
* XmlReader.cs : Added Settings and SchemaInfo properties.
* XmlReaderSettings.cs : Added NameTable. Throw XmlException when
attempt to set Schemas.
* XmlTextReader.cs : Fixed "Evidences" to "Evidence". new csc rejected
implicit int->char cast.
* XmlValidatingReader.cs : Fixed "Evidences" to "Evidence".
svn path=/trunk/mcs/; revision=30919
W3C DOM compliant read-only check support (buggy part in MS.NET).
* XmlAttribute.cs,
XmlCDataSection.cs,
XmlCharacterData.cs,
XmlDocument.cs,
XmlElement.cs,
XmlNode.cs,
XmlSignificantWhitespace.cs,
XmlText.cs
: CloneNode() - set read-only when copied node is read-only.
Check IsReadOnly on attempt to modify value.
* XmlEntity.cs,
XmlEntityReference.cs : Set descendant nodes read-only.
* XmlAttributeCollection.cs,
XmlNode.cs
: Fixed incompatible exception type.
* XmlEntityReference.cs : CloneNode() should not pass an empty string
as its name.
* XmlEntityReference.cs,
XmlProcessingInstruction.cs : Check XML name validity.
* XmlText.cs : CloneNode() does not have to check children.
svn path=/trunk/mcs/; revision=25938
* XmlCharacterData.cs : ReplaceData() should reject negative integer
value for count argument.
* XmlAttribute.cs, XmlAttributeCollection.cs, XmlNamedNodeMap.cs :
On RemoveNamedItem(), default attribute value should be restored.
svn path=/trunk/mcs/; revision=24511
* XmlAttributeCollection.cs : Remove() should throw an exception when
target attribute is not included in the collection.
* XmlDocument.cs : ImportNode() should reject null node.
* XmlNode.cs : Fixed type of exception for invalid insertion.
It should throw an exception not only when the owner document of the
reference element is different but its parent element is different.
Some error message improvement.
svn path=/trunk/mcs/; revision=24509
* XmlAttributeCollection.cs : set owner element as parent on removal
events (though they are not "parent" in infoset or dom context)
* XmlElement.cs : Don't remove attributes twice (raises extraneous
removal events).
* XmlNamespaceManager.cs, XmlNodeChangedEventArgs :
Added NET_1_2 members.
svn path=/trunk/mcs/; revision=22933
* DTDValidatingReader.cs : Fixed MoveToElement() that causes incorrect
IsDefault and Depth.
* XmlAttribute.cs : Fixed .ctor(). Omit more namespace check when
checkNamespace = false.
* XmlNamedNodeMap.cs : Fixed SetNamedItem() to raise events.
* XmlAttributeCollection.cs : Reimplemented InsertAfter to use
InsertBefore() (similar to XmlNode).
* XmlDocument.cs : Added internal .ctor(). Reimplemented ReadNode()
as recursive, to make event order compatible.
* XmlDocumentType.cs : Use SetNamedItem() (to raise events).
* XmlElement.cs : Some refactory. Fixed SetAttributeNode() with
string name to block prefixed name.
* XmlEntity.cs : Don't raise events on setting contents.
* XmlNode.cs : Some refactory. Added raiseEvent argument to internal
InsertBefore().
* XmlEntityReference.cs : related fix for XmlNode change.
* XmlTextReader.cs : When the reader is on "attributes" of xmldecl or
doctype, Depth 1 lower than usual attribute. Split large function.
svn path=/trunk/mcs/; revision=22799
* XmlAttribute.cs : when set a value, it is no longer default
(even if the value is the same as default value).
* XmlAttributeCollection.cs : Remove() should recover default attribute
value to default, not specified value.
Patch by Boris Kirzner (modified a bit)
* XmlDocument.cs : Reference to undeclared entity is not allowed in
Load(), while allowed in ReadNode(). Added such distinguishing logic.
svn path=/trunk/mcs/; revision=22052
* XmlAttributeCollection.cs,
XmlElement.cs : Fixed bug #51415.
When adding attribute to an element using Attributes, it failed.
svn path=/trunk/mcs/; revision=21059
* XmlAttributeCollection.cs : Fixed synchronization stuff.
* XmlConvert.cs : Added two FromBinHexString() methods.
* XmlTextReader.cs : Modified to use one of the above method.
* XmlValidatingReader.cs : XsdValidatingReader.XmlResolver will be
disabled (in the next commit), so resolver won' be set to it.
Attempt to validate against XDR now throws NotSupportedException.
svn path=/trunk/mcs/; revision=19191
* XmlInputStream.cs :
Fixed Initialize() that might result in incorrect buffer.
CanRead and Position should consider buffer (especially when the
stream was EOF).
CanSeek should use stream's CanSeek.
* XmlChar.cs : added GetPredefinedEntity().
* DTDObjectModel.cs :
- Modified ComputeDefaultValue() to use it.
- Fixed NormalizedDefaultValue not to expect parsed value as string.
- ResolveExternalEntity now detects invalid standalone specification.
- DTDParameterEntityDeclaration.Value is now changed to property and
keep its resolved value of literal value of external value using
new Resolve (XmlResolver) method (called only by XmlTextReader).
* DTDValidatingReader.cs :
- It now handles entity-expanded Whitespace and SignificantWhitespace
correctly. Does not raise unexpected text not allowed error.
- Fixed MoveToAttribute()s to move internal reader correctly, and
should be able to move in other cases than on element node.
- On Read()ing document type and ResolveEntity(), it now sets
XmlResolver on text reader.
- On ID constraints check and type verification, it now uses
normalized attribute or its tokenized value(s).
- Fixed ValidateAttributes() to add default values when
ValidationType is Auto.
* XmlParserContext.cs : added internal Dtd setter.
* XmlParserInput.cs :
InsertParameterEntityBuffer() should add surrounding whitespaces.
Removed unused code block.
* XmlTextReader.cs :
- Modified ReadReference(), ReadAttribute() and Dereference() to use
XmlChar.GetPredefinedEntity().
- When returning entity reference, it checks extity declaration
existence in certain conditions.
- ReadAttribute() now skips general entity replacement on reading
entity value.
- ReadText() now handles whitespace texts as XmlNodeType.Whitespace.
- ReadXmlDeclaration() holds isStandalone, which might be used in
entity reference's well-formedness check.
- internal 'DTD' now uses XmlParserContext.Dtd.
- isInternalSubset was meaningless. Now uses input stack's Count.
- Added some required SkipWhitespace().
- Several parameter entity handling changes. Added GetPEValue(name).
TryExpandPERef() now uses ImportAsPERef(). ReadParameterEntityDecl()
now uses its Resolve() when it was external PE. Now it uses value
buffer instead of currentTag, to efficiently read (included) PE.
CompileDeclaration() now uses ImportAsPERef instead of ExpandPERef().
ImportAsPERef() simply inserts the value to currentInput.
ReadEntityDecl() also uses value buffer. Removed non-used methods.
- Default attributes are now stored in normalized form.
- Dereference() now considers non-expanding predefined entities.
* XmlValidatingReader.cs : now holds Schemas, and ValidationType.Auto
is more correctly supported.
* XmlAttributeCollection.cs :
When removing default attribute, it immediately inserts the attribute.
RemoveAll() should consider default (not-removable) attributes.
* XmlDocument.cs :
Should have its default XmlResolver. Added Internal Resolver.
Some Load() should use its XmlResolver.
ImportNode() should copy its children in node level, not value level.
It also have to consider not to copy default attribute on importing
XmlElement.
* XmlDocumentType.cs : Now uses document's XmlResolver to read DTD.
* XmlAttribute.cs,
XmlDocumentFragment.cs.
XmlElement.cs : use XmlResolver on InnerXml. Removed some MonoTODO.
* XmlNodeReader.cs : GetInternalParserConext() should provide its DTD.
ResolveEntity() uses XmlResolver on entityReader.
svn path=/trunk/mcs/; revision=17202
* DTDObjectModel.cs :
- Added validation error check (and AddError(), Errors).
- Fixed ComputeDefaultValue() to handle various references correctly.
- DTDEntityDeclaration.EntityValue became property, and added
LiteralEntityValue. The new one holds resolved value.
Added ResolveExternalEntity(). It now required root in .ctor().
* DTDValidatingReader.cs :
- Now it handles namespaced attributes (as input to xsd validator).
- Added XmlResolver property as usual XmlReader.
- Added currentEntityHandling field so that it can stand changing
XmlValidatingReader's EntityHandling dynamically.
- FilterNormalization() now requires name for getting datatypes and
can stand for non-current attribute normalization.
- Splitted ReadContent() from Read() that can be called recursively
when expanding entities.
- Now handles Entity not found error *after* resolution of entities,
as MS.NET does.
- Read()ing DTD checks its Errors and raises validation error events.
In some situations, DTD parsing may detect VC error, not WFC error.
It also strictly checks NData existence.
- Handling of entity-resolved text is a bit changed and Read()ing
element, endElement, cdata now changed to switch collecting text
and collected text.
- content type ANY should allow texts.
- Added enumerated attribute validity check.
- Added Name/Names creation rule check for ID/IDREF/IDREFS.
- Added entity existence check for ENTITY/ENTITIES attributes.
- Added NMTOKEN creation rule check for NMTOKEN/NMTOKENS.
- Fixed to remove extraneous #REQUIRED check.
- Contributing default attribute is now only applied to the case
ValidationType is DTD or None.
- ResolveEntity() now handles external entities.
Added Mono.Xml.IXmlParserContext interface support.
* XmlDocumentType.cs : Fixed to use BaseURI to build DTD model.
* XmlTextReader.cs :
- Fixed ReadAttributeValue() to reset returnEntityReference.
- Added bool MaybeTextDecl only for ResolveEntity().
- Fixed ReadWhitespace(). In fact its value is considered even if it
is in the end of the XML.
- Fixed ReadXmlDeclaration(). Now skips text declaration.
- CompileDTDSubset() now checks IGNORE/INCLUDE section end balances.
- ReadContentSpec() should set OrderType = OR for mixed model.
Fixed to set content element name correctly.
- ImportAsPERef() now skips Text declaration.
- Type of enumerated default attributes shold be string.
- Undeclared PE error is now handled as DTD's VC error, not
XmlTextReader's WFC error.
* XmlValidatingReader.cs : BaseURI should provide that of
original XmlReader's when read was not started yet.
Fixed XmlResolver to delegate to DTDValidatingReader.
* XmlAttributeCollection.cs : Acquiring attList declaration is
insufficient especially in case of lack of elementdecl.
* XmlChar.cs : (Maybe this is compact than XmlConstructs.)
added IsWhitespace(),IsNCNameChar(),IsName(),IsNCName(),IsNmToken(),
IsPubid(). Copies IsValidIANAEncoding() from XmlConstructs.
* XmlInputStream.cs : Removed "version" declaration check. It should
be done by XmlTextReader.
* XmlNodeReader.cs : added internal GetInternalParserContext() and now
it can be used in XmlValidatingReader.ResolveEntity().
ResolveEntity() sets XmlTextReader.MaybeTextDecl.
svn path=/trunk/mcs/; revision=17167
* DTDValidatingReader.cs :
- Added ID support in ValidateAttributes().
- More refined ReadAttributeValue() support for non-expanding entity
situation
- It should handle LocalName, Name, Prefix, NamespaceURI and Value
correctly when the reader is on each of the value nodes of an
attribute. Now XmlDocument.ReadNode() should work well.
* XmlDocument.cs :
- added idTable, AddIdenticalAttribute(), GetIdenticalAttribute() and
RemoveIdenticalAttribute()
- Implemented GetAttributeById().
* XmlAttributeCollection.cs :
- added private ownerDocument property and replaced
ownerElement.OwnerDocument with it.
- Added AdjustIdenticalAttribute() and it is used in SetNamedItem().
It calls XmlDocument.{Add|Remove}IdenticalAttribute().
- Added RemoveIdenticalAttribute() and it is used in Remove().
(I also added AddIdenticalAttribute() but is not used.)
svn path=/trunk/mcs/; revision=16717
* changed XPathNodeType modifier to internal *protected* override.
* XmlAttribute.cs : .ctor() now checks name validity e.g. xmlns.
* XmlAttribute.cs, XmlElement.cs : set_Prefix checks NCName validity.
* XmlAttributeCollection.cs : removed some incorrect TODO attributes.
* XmlDocument.cs ; CreateAttribute(name) now auto-completes xmlns NSURI
when the argument is "xmlns".
* XmlElement.cs : more compliant IsEmpty support. See also WriteTo().
* XmlNamespaceManager.cs : added initial "xml" and "xmlns" namespaces.
* XmlNode.cs : ser_InnerXml() throws InvalidOperationException.
* XmlNodeReader.cs : LookupNamespace() refactory. Fixed ReadInnerXml()
not to set error state for non-started XmlNodeReader.
* XmlTextReader.cs : fixed ReadAttributeValue() not to reset state.
BaseURI support. Fixed Initialize() to handle Attribute correctly.
SetProperty for attribute auto-completes xmlns NSURI.
Attribute and whitespace handling became more correct.
Don't parse external DTD if XmlResolver is null.
* XmlTextWriter.cs : implemented WriteEntityRef().
WriteStartAttribute() checks if ns does not equal to that of xmlns.
* XmlWriter.cs : trivial refactoring (WriteNode() xmldecl output).
svn path=/trunk/mcs/; revision=14613