Commit Graph
121 Commits
Author SHA1 Message Date
Marek Safar 5b82f0e08c Clean up some NET_2_0 2012-06-14 15:44:35 +01:00
Atsushi Eno e94b0eb15f Result-preserving node list while not performance-harmful until node removal.
Node removal while iterating should be prohibited as documented in MSDN though.
2011-03-10 22:40:44 +09:00
Atsushi Eno 9021910845 Do not return DocumentFragment from AppendChild() etc. Fixed bug #666249. 2011-01-31 13:27:46 +09:00
Atsushi Eno 5cb7940543 2010-05-12 Atsushi Enomoto <[email protected]>
* XmlNode.cs : use as-operator (isinst) to optimize certain use case.
	  Patch by Tom Hindle.


svn path=/trunk/mcs/; revision=157244
2010-05-12 15:04:05 +00:00
Marek Safar 2be4aa8ed9 Warnings cleanup
svn path=/trunk/mcs/; revision=111842
2008-08-28 17:11:51 +00:00
Atsushi Eno c377364220 2007-06-13 Atsushi Enomoto <[email protected]>
* XmlNode.cs : InnerText is settable on XmlDocumentFragment (silly,
	  but since XmlDocumentFragment does not override this property
	  it must be handled here).

	* XmlDocumentFragmentTests.cs : added InnerText().
	* XmlWriterSettingsTests.cs : replace \r\n with \n to make it pass
	  on windows.


svn path=/trunk/mcs/; revision=79457
2007-06-13 17:29:58 +00:00
Konstantin Triger fe898472cf cosmetic fix for the exception type
svn path=/trunk/mcs/; revision=76822
2007-05-07 10:44:31 +00:00
Atsushi Eno 78b764c7e7 2006-12-20 Atsushi Enomoto <[email protected]>
* XmlNode.cs : (InsertBefore) when newChild == refChild, do nothing
	  except for node type check. Fixed bug #80331.

	* XmlNodeTests.cs : added tests for bug #80331.


svn path=/trunk/mcs/; revision=69837
2006-12-20 19:46:13 +00:00
Atsushi Eno efcfec2517 2006-12-12 Atsushi Enomoto <[email protected]>
* XmlNode.cs : InnerText was returning comment text when there was
	  only a Comment node. Fixed bug #80233.

	* XmlNodeTests.cs : added test for bug #80233.


svn path=/trunk/mcs/; revision=69392
2006-12-12 12:15:13 +00:00
Atsushi Eno 23638c8d3c 2006-12-05 Atsushi Enomoto <[email protected]>
* XmlNode.cs : GetPrefixOfNamespace() was not correctly searching
	  ancestors' namespaces.

	* XPathEditableDocument.cs : those writers should lookup prefix when
	  WriteStartElement/WriteStartAttribute are passed null prefix.
	  Removed nodeStack in XmlDocumentInsertionWriter, since nodes are
	  always added to current node immediately.

	* XmlNodeTests.cs : added another test for GetPrefixOfNamespace().

	* XPathNavigatorTests.cs : added test for XPath navigator editor's
	  LookupPrefix().


svn path=/trunk/mcs/; revision=69021
2006-12-05 10:07:29 +00:00
Atsushi Eno f97f300d60 2006-08-17 Atsushi Enomoto <[email protected]>
* XmlEntity.cs, XmlEntityReference.cs, XmlNode.cs :
	  create entity content only when its children is being accessed.
	  It results differently when there is no actual reference in the
	  document - an invalid entity value (when it is used to create
	  child nodes) is ignored unless a code tries to access the Value
	  of an XmlEntity. Fixed bug #79091
	* DTDReader.cs : the fix above uncovered another bug (ibm66n03.xml).
	  Check illegal reference name in literal entity value.


svn path=/trunk/mcs/; revision=63900
2006-08-17 11:55:56 +00:00
Atsushi Eno 4cd416ff69 2006-02-21 Atsushi Enomoto <[email protected]>
* XmlTextWriter2.cs : (WriteStartAtribute) more == removal.
	* XmlNode.cs : (get_InnerText) reduce extra StringBuilder creation.


svn path=/trunk/mcs/; revision=57108
2006-02-21 20:59:25 +00:00
Atsushi Eno cbc55bdc39 2006-02-16 Atsushi Enomoto <[email protected]>
* IHasXmlChildNode.cs :
	  New internal interface to hold LastLinkedChild.
	* XmlNodeListChildren.cs XmlEntity.cs XmlElement.cs XmlAttribute.cs
	  XmlLinkedNode.cs XmlEntityReference.cs XmlNode.cs
	  XmlDocumentFragment.cs XmlDocument.cs : use it. It minimizes memory
	  consumption in XmlText, XmlWhitespace, XmlComment etc.

	* System.Xml.dll.sources : added IHasXmlChildNode.cs.


svn path=/trunk/mcs/; revision=56945
2006-02-16 15:46:11 +00:00
Atsushi Eno 4bacaff049 2006-01-30 Atsushi Enomoto <[email protected]>
* XmlDocument.cs, XmlAttribute.cs, XmlElement.cs : Avoid unnecessary
	  name checks in CreateElement() and CreateAttribute().
	  get_DocumentType() could be stopped when the iterated child node
	  is the document element.
	* XmlNode.cs : removed commented lines.
	* XmlNameEntry.cs : hash code for a name entry is mostly identical by
	  its local name, so avoid extraneous GetHashCode() especially on
	  namespaces.



svn path=/trunk/mcs/; revision=56270
2006-01-30 19:30:59 +00:00
Atsushi Eno c2471811ff 2006-01-28 Atsushi Enomoto <[email protected]>
* XmlNode.cs, XmlIteratorNodeList.cs :
	  Now we can enable XmlIteratorNodeList again (mcs, incorrectly
	  removing nodes in the node list, was fixed).


svn path=/trunk/mcs/; revision=56200
2006-01-28 07:53:16 +00:00
Atsushi Eno b6fd808562 2006-01-27 Atsushi Enomoto <[email protected]>
* XmlNode.cs : disabled XmlIteratorNodeList optimization. It caused
	  some kind of regression under mcs/tests/xml-025.cs.


svn path=/trunk/mcs/; revision=56153
2006-01-27 10:22:40 +00:00
Atsushi Eno f98a6cf05b 2006-01-27 Atsushi Enomoto <[email protected]>
* XmlNode.cs,
	  XmlDocument.cs,
	  XmlAttribute.cs,
	  XmlElement.cs :
	  Added internal AppendChild() override that omites node type
	  checking, and used it in many places.


svn path=/trunk/mcs/; revision=56151
2006-01-27 08:38:28 +00:00
Atsushi Eno 635a196821 2006-01-27 Atsushi Enomoto <[email protected]>
* XmlNode.cs :
	  in get_InnerText(), avoid extraneous StringBuilder creation.


svn path=/trunk/mcs/; revision=56149
2006-01-27 07:06:09 +00:00
Atsushi Eno 150bf8474d 2006-01-27 Atsushi Enomoto <[email protected]>
* System.Xml.dll.sources : added XmlIteratorNodeList.cs.

	* XmlIteratorNodeList.cs : new file for XmlNodeList implementation.
	  It does not iterate all nodes in advance.
	* XmlNode.cs : use XmlIteratorNodeList in SelectNodes().


svn path=/trunk/mcs/; revision=56148
2006-01-27 06:29:26 +00:00
Atsushi Eno 16aacc0e88 2005-12-14 Atsushi Enomoto <[email protected]>
* XmlNode.cs : (GetNamespaceOfPrefix) return const xml/xmlns URIs
	  only under 2.0.


svn path=/trunk/mcs/; revision=54356
2005-12-14 11:13:40 +00:00
Atsushi Eno 5392ed3dbb 2005-12-14 Atsushi Enomoto <[email protected]>
* XmlNode.cs : under 2.0 xml/xmlns are treated as special cases in
	  GetNamespaceOfPrefix()/GetPrefixOfNamespace() (but it still does not
	  implement IXmlNamespaceResolver, bummer).


svn path=/trunk/mcs/; revision=54352
2005-12-14 08:30:12 +00:00
Atsushi Eno f4112a5629 2005-11-10 Atsushi Enomoto <[email protected]>
* XmlReader.cs, XmlNode.cs :
	  [DebuggerDisplay] are not worthy of existing.

	* XPathNavigator.cs, XPathNodeIterator.cs :
	  [DebuggerDisplay] are not worthy of existing.


svn path=/trunk/mcs/; revision=52880
2005-11-10 18:30:39 +00:00
Atsushi Eno 38e3987552 2005-11-07 Atsushi Enomoto <[email protected]>
* XmlReader.cs : dependent XmlSchemaValidationFlags fix.
	  Added ReadElementContentAsObject() and ReadContentAsObject().
	* XmlReader.cs, XmlTextReader.cs :
	  LookupNamespace(string,bool) is now private.
	* XmlReader.cs, XmlNode,cs :
	  [DebuggerDisplay].

	* XmlSchemaValidationFlags.cs : updated to match 2.0 RTM.
	* XmlSchemaValidator.cs : related fix.

	* XmlSchemaValidatingReader.cs : XmlSchemaValidationFlags is updated.

	* XmlReaderSettingsTests.cs : XmlSchemaValidationFlags is updated.



svn path=/trunk/mcs/; revision=52659
2005-11-07 17:22:05 +00:00
Atsushi Eno 6d7725e5bb 2005-11-07 Atsushi Enomoto <[email protected]>
* XmlElement.cs, XmlCDataSection.cs, XmlText.cs, XmlWhitespace.cs,
	  XmlSignificantWhitespace.cs : added ParentNode overrides (actually
	  they don't make sense since it just calls base.)
	* XmlNode.cs, XmlDocument.cs : changed .NET 2.0 CreateNavigator() impl
	  to match signature and skip OwnerDocument check in XmlNode (since
	  it is overriden). Maybe MS does not have ownerDocument as a field and
	  costs too much on OwnerDocument property.
	  Added missing bits in XmlDocument.


svn path=/trunk/mcs/; revision=52647
2005-11-07 11:42:17 +00:00
Atsushi Eno bc2aba513c 2005-11-07 Atsushi Enomoto <[email protected]>
* XmlAttribute.cs : added new overrides in 2.0 RTM (this scarcely
	  makes sense without real optimization though).
	* XmlDocument.cs, XmlElement.cs, XmlNode.cs : avoid ChildNodes and
	  save extra XmlNodeList creation cost.


svn path=/trunk/mcs/; revision=52646
2005-11-07 10:37:57 +00:00
Atsushi Eno 2da6c2e2c0 2005-09-21 Atsushi Enomoto <[email protected]>
* XmlNodeReader2.cs, XmlReader.cs,
	  XmlTextReader.cs, XmlTextReader2.cs,
	  XmlNodeChangedEventArgs.cs, XmlElement.cs,
	  XmlNode.cs, XmlDocument.cs :
	  updated NET_2_0 API.

	* XmlReaderSettingsTests.cs : updated NET_2_0 related tests.
	* NameTableTests.cs : numbered testcases. fixed argument order.


svn path=/trunk/mcs/; revision=50351
2005-09-21 02:58:41 +00:00
Andrew Skiba 68bc7c0afb remove unnecessary argument from AppendChildValues function
svn path=/trunk/mcs/; revision=46347
2005-06-22 07:32:01 +00:00
Atsushi Eno 53db25ba5f 2005-06-06 Atsushi Enomoto <[email protected]>
* XmlEntityReference.cs, XmlNode.cs : protected api fix.


svn path=/trunk/mcs/; revision=45504
2005-06-06 16:27:08 +00:00
Atsushi Eno 5f139203fd 2005-06-02 Atsushi Enomoto <[email protected]>
* XmlEntityReference.cs, XmlNode.cs : For entity references, BaseURI 
	  resolution should be different from that of parent since they might
	  differ. Patch by Andrew Skiba.


svn path=/trunk/mcs/; revision=45323
2005-06-02 11:41:00 +00:00
Atsushi Eno 0905ad6b9e 2005-03-22 Atsushi Enomoto <[email protected]>
* XmlParserInput.cs,
	  XmlNode.cs,
	  XmlUrlResolver.cs,
	  DTDValidatingReader.cs : removed/commented out those warned code.


svn path=/trunk/mcs/; revision=42059
2005-03-22 07:09:06 +00:00
Atsushi Eno 5d693154f9 2005-02-25 Atsushi Enomoto <[email protected]>
* XmlComment.cs, XmlNode.cs, XmlText.cs, XmlProcessingInstruction.cs,
	  XmlEntityReference.cs, XmlSignificantWhitespace.cs, XmlAttribute.cs,
	  XmlElement.cs, XmlEntity.cs, XmlCDataSection.cs :
	  For those nodes that are created by Clone(), IsReadOnly is false.
	  Patch by Konstantin Triger.

	* XmlNodeTests.cs : added Clone() of readonly node returns a node
	  that is not readonly.



svn path=/trunk/mcs/; revision=41185
2005-02-25 09:39:56 +00:00
Atsushi Eno 1b6d1852f5 2005-02-17 Atsushi Enomoto <[email protected]>
* XmlNode.cs : It does not have to iterate children to find argument
	  node. Fixed exception type to ArgumentException. Patch by Andrew
	  Skiba.


svn path=/trunk/mcs/; revision=40793
2005-02-17 07:58:10 +00:00
Martin Baulig 06dbf17232 2005-01-25 Martin Baulig <[email protected]>
* XmlNode.cs (XmlNode.SchemaInfo): Mark this as not CLS-compliant
	to avoid a CS3025.

	* XmlReaderSettings.cs (XmlReaderSettings.XmlResolver): Mark this
	as not CLS-compliant to avoid a CS3025.


svn path=/trunk/mcs/; revision=39449
2005-01-25 01:02:31 +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 687a961cb8 2005-01-17 Atsushi Enomoto <[email protected]>
* XmlNode.cs, XmlAttribute.cs : reverted the previous patch. It broke
	  several nunit tests.

	  ..Missed the commits except for ChangeLog :(


svn path=/trunk/mcs/; revision=39021
2005-01-17 14:34:45 +00:00
Ben Maurer acdce6f0fd 2005-01-15 Ben Maurer <[email protected]>
* XmlNode.cs (InnerText, AppendChildValues): Don't allocate a
	string in the case where nothing needs to be appended.

	* XmlAttribute.cs (BuildChildValue): Start out the string with
	`null' not `String.Empty'. String.Concat (null, blah) == blah,
	pointerwise. ie, there is no allocation. This makes it so that
	getting the value of an attribute is faster for the fast case.


svn path=/trunk/mcs/; revision=38983
2005-01-16 02:51:22 +00:00
Atsushi Eno f305240c9c 2004-12-16 Atsushi Enomoto <[email protected]>
* XmlSchemaInfo.cs : added internal copy constructor.

	* XmlReader.cs : added MoveToFollowing().
	* XmlNode.cs,
	  XmlElement.cs,
	  XmlAttribute.cs : added SchemaInfo support.
	* XmlDocument.cs : added Schemas and Validate().
	  ReadNode() now copies xmlReader's SchemaInfo.
	* XmlNodeReader.cs : ditto (just reflects node's SchemaInfo).

	* SubtreeXmlReader.cs, XmlFilterReader.cs :
	  Override SchemaInfo to return input reader's SchemaInfo.



svn path=/trunk/mcs/; revision=37829
2004-12-16 12:16:32 +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 0018d2cc28 2004-10-29 Atsushi Enomoto <[email protected]>
* XmlDocumentNavigator.cs : GetNode() should consider namespace nodes.
	* XmlNode.cs : dustclean.

svn path=/trunk/mcs/; revision=35415
2004-10-29 01:13:03 +00:00
Atsushi Eno be71f854d6 2004-10-28 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : use XPathEditableDocument again.
	* XmlNode.cs : To be compatible with XPathEditableDocument, it should
	  not cast XPathNavigator to XmlDocumentNavigator but to IHasXmlNode.

svn path=/trunk/mcs/; revision=35389
2004-10-28 06:27:46 +00:00
Atsushi Eno 33c1b6ca8d 2004-09-06 Atsushi Enomoto <[email protected]>
* XmlNode.cs : GetEnumerator() does not have to create ChildNodes
	  every time. Removed unused StringBuilder field.

svn path=/trunk/mcs/; revision=33435
2004-09-06 17:28:58 +00:00
Atsushi Eno a144b12327 2004-08-27 Atsushi Enomoto <[email protected]>
* XmlAttribute.cs : some property getters threw NullReferenceException
	  when the attribute is not added to an element.
	* XmlNode.cs : When a node is not appended to another node, BaseURI
	  is empty. Bug #64120 is fixed.

svn path=/trunk/mcs/; revision=32914
2004-08-27 00:36:03 +00:00
Atsushi Eno 63bd1901a0 2004-07-20 Atsushi Enomoto <[email protected]>
* XmlNode.cs : When the argument node being inserted is the existing
	  document element, it should not result in an error (since it should
	  be first removed from document, thus no error should happen).

svn path=/trunk/mcs/; revision=31299
2004-07-20 03:40:04 +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 47029604e8 2004-06-18 Atsushi Enomoto <[email protected]>
* DTDObjectModel.cs, DTDReader.cs, XmlConvert.cs, XmlDocument.cs,
	  XmlException.cs, XmlParserInput.cs, XmlTextReader.cs,
	  XmlTextWriter.cs : Globalization.
	* XmlNode.cs : Fixed error message that confused node type.

svn path=/trunk/mcs/; revision=29825
2004-06-18 01:22:07 +00:00
Atsushi Eno 825cdda66f 2004-05-23 Atsushi Enomoto <[email protected]>
* XmlNode.cs : RemoveChild() should check null argument.
	  Normalize() was broken in some cases.

svn path=/trunk/mcs/; revision=27909
2004-05-23 12:10:52 +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 a5e122f6a2 2004-04-24 Atsushi Enomoto <[email protected]>
* DTDReader.cs, XmlConvert.cs, XmlDeclaration.cs, XmlImplementation.cs,
	  XmlNode.cs : Culture independency fix.

svn path=/trunk/mcs/; revision=25929
2004-04-24 10:15:09 +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 9bd7b7cfc6 2004-02-10 Atsushi Enomoto <[email protected]>
* XmlNode.cs : ChildNodes should not create XmlNodeListChildren
	  every time. This fix heavily improved performance.

svn path=/trunk/mcs/; revision=22937
2004-02-10 08:33:28 +00:00