Commit Graph
30 Commits
Author SHA1 Message Date
Atsushi Eno 2b68d146fa 2009-11-11 Atsushi Enomoto <[email protected]>
* XmlDocument.cs, XmlElement.cs, XmlAttribute.cs,
	  XmlAttributeCollection.cs :
	  when CreateElement() and/or CreateAttribute() are overriden,
	  use overriden method. Otherwise, use internal optimal ones.
	  Fixed bug #549839.


svn path=/trunk/mcs/; revision=145920
2009-11-11 04:27:02 +00:00
Atsushi Eno 361af0a399 2009-09-15 Atsushi Enomoto <[email protected]>
* 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
2009-09-15 12:40:28 +00:00
Atsushi Eno 6ffb2498cf 2009-04-22 Atsushi Enomoto <[email protected]>
* 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
2009-04-22 04:46:09 +00:00
Atsushi Eno 680bfdbdee 2008-04-17 Atsushi Enomoto <[email protected]>
* 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
2008-04-17 16:02:53 +00:00
Atsushi Eno b3e660af62 2006-01-27 Atsushi Enomoto <[email protected]>
* 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
2006-01-27 09:32:28 +00:00
Atsushi Eno e65be58d88 2005-01-18 Atsushi Enomoto <[email protected]>
* 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
2005-01-18 10:41:55 +00:00
Atsushi Eno 16dd4c5974 2004-11-26 Atsushi Enomoto <[email protected]>
* XmlReader.cs : not fixage, just explicitly formatted code a bit.
	* XmlTextReader.cs,
	  XmlEntity.cs,
	  XmlAttributeCollection.cs,
	  XmlTextWriter.cs,
	  XmlElement.cs,
	  XmlNode.cs,
	  DTDObjectModel.cs,
	  XmlParserInput.cs,
	  DTDReader.cs,
	  XmlDocument.cs : warning removal.



svn path=/trunk/mcs/; revision=36587
2004-11-26 02:51:06 +00:00
Atsushi Eno 93314cd44c 2004-07-09 Atsushi Enomoto <[email protected]>
* 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
2004-07-09 06:30:18 +00:00
Duncan Mak 8fa6e766dd Add MIT license to System.XML.DLL
svn path=/trunk/mcs/; revision=30055
2004-06-21 18:07:31 +00:00
Atsushi Eno 268271966d 2004-04-24 Atsushi Enomoto <[email protected]>
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
2004-04-24 14:23:56 +00:00
Atsushi Eno ca7962559c 2004-03-24 Atsushi Enomoto <[email protected]>
* 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
2004-03-24 03:45:22 +00:00
Atsushi Eno 3aee5d6284 2004-03-24 Atsushi Enomoto <[email protected]>
* 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
2004-03-24 02:21:48 +00:00
Atsushi Eno 0e242ba0a0 2004-02-10 Atsushi Enomoto <[email protected]>
* 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
2004-02-10 05:41:09 +00:00
Atsushi Eno 8256002451 2004-02-08 Atsushi Enomoto <[email protected]>
* DTDObjectModel.cs : Limit external entity reference from DTD by 256.
	  foreach elimination.  DTDParameterEntityDeclaration should set Root.
	  Compute attribute default value without raising an error.
	  (for non-error reporting reader)
	* DTDReader.cs : Fixes for the above fixes. foreach elimination.
	* DTDValidatingReader.cs, NameTable.cs, XmlAttribute.cs,
	  XmlAttributeCollection.cs, XmlChar.cs, XmlConstruct.cs,
	  XmlDocumentFragment.cs, XmlDocumentNavigator.cs, XmlElement.cs,
	  XmlEntityReference.cs, XmlNamedNodeMap.cs, XmlNode.cs,
	  XmlText.cs : foreach elimination.
	* XmlDocument.cs, XmlSignificantWhitespace.cs, XmlWhitespace.cs :
	  foreach elimination. Removed unnecesary methods.
	* XmlTextReader.cs : code format refactory. Optimized some methods.
	  foreach elimination. Replaced Stack with string array.
	  Replaced StringBuilder with char array. Removed unnecessary methods.

svn path=/trunk/mcs/; revision=22891
2004-02-08 20:27:04 +00:00
Atsushi Eno c90d6dba5b 2004-02-06 Atsushi Enomoto <[email protected]>
* 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
2004-02-05 16:05:56 +00:00
Atsushi Eno 4a3a3b770d 2004-01-14 Atsushi Enomoto <[email protected]>
* 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
2004-01-14 07:55:50 +00:00
Atsushi Eno da54c77a46 2003-12-12 Atsushi Enomoto <[email protected]>
* XmlAttributeCollection.cs,
	  XmlElement.cs : Fixed bug #51415.
	  When adding attribute to an element using Attributes, it failed.

svn path=/trunk/mcs/; revision=21059
2003-12-12 07:13:08 +00:00
Atsushi Eno b8058c932d 2003-10-19 Atsushi Enomoto <[email protected]>
* 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
2003-10-19 13:56:55 +00:00
Atsushi Eno 54cf27af0a 2003-08-08 Atsushi Enomoto <[email protected]>
* 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
2003-08-09 09:48:35 +00:00
Atsushi Eno 87249885f7 2003-08-07 Atsushi Enomoto <[email protected]>
* 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
2003-08-07 22:08:17 +00:00
Atsushi Eno 3d09dbb9c9 2003-07-26 Atsushi Enomoto <[email protected]>
* 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
2003-07-26 19:39:32 +00:00
Atsushi Eno d758de53b7 2003-05-16 Atsushi Enomoto <[email protected]>
* 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
2003-05-15 20:13:22 +00:00
Atsushi Eno 57fc30817d *** empty log message ***
svn path=/trunk/mcs/; revision=8952
2002-11-12 15:58:31 +00:00
Atsushi Eno c58e43d768 *** empty log message ***
svn path=/trunk/mcs/; revision=8798
2002-11-03 11:40:38 +00:00
Matt Hunter 07aae53fac implementing XmlElement.SetAttributeNode(localName, namespaceURI) and
implementing XmlAttributeCollection.Append(XmlAttribute)

svn path=/trunk/mcs/; revision=7680
2002-09-21 04:20:31 +00:00
Jason Diamond d0cd6199a5 Implementation and tests for XmlAttributeCollection.RemoveAll and XmlElement.RemoveAllAttributes courtesy of Matt Hunter <[email protected]>.
svn path=/trunk/mcs/; revision=6926
2002-08-23 05:09:53 +00:00
Piers Haken c004fb1899 2002-07-12 Piers Haken <[email protected]>
* XmlAttributeCollection.cs: implement some ItemOf indexers
	* XmlNamedNodeMap.cs: add internal 'Nodes' accessor for the nodeList field
	* XmlNode.cs: SelectNodes: return empty XmlNodeList, not null

svn path=/trunk/mcs/; revision=5722
2002-07-12 10:52:08 +00:00
Jason Diamond b85325090c Got attributes and text nodes working while loading a document.
svn path=/trunk/mcs/; revision=2848
2002-03-03 00:35:09 +00:00
Daniel Weber f856b27cc4 * XmlAttribute.cs re-arrange source file to put attributes first. Implement
value, modify constructor

* XmlAttributeCollection.cs - Fix bug on owner document check, add TODO - Make
insert operations match XmlNode insertion on null pointer refNode.

* XmlDeclaration.cs - Add copyright info to top of file

* XmlDocument.cs - implement localName, Name

* XmlDocumentFragment.cs : first cut at implementation.  Implement name,
localName

* XmlElement.cs - implement value, modify constructor

* XmlNames_1_0.cs - add IsXmlName function, fix bug in IsXmlChar()

* XmlNode.cs - implement BaseURI and value, add more comments

* XmlWriter.cs - begin stubbing out methods

* Added XmlUtil.cs - Internal class. Contains static utility methods that are non-Xml version
specific, mostly character encoding conversions

* Added XmlInputSource.cs - internal class to handle streaming Xml input.

* Added DomEncodingType.cs - internal enueration class to detail supported encodings
(ISO-8859-n, UTF-8/UTF-16, eg)

svn path=/trunk/mcs/; revision=1467
2001-11-29 10:49:39 +00:00
Daniel Weber 04639cc5f0 finish adding stubs to begin work on XmlDocuemnt.Load(file)
Most files are merely placeholders.

svn path=/trunk/mcs/; revision=1390
2001-11-19 20:30:08 +00:00