Commit Graph
145 Commits
Author SHA1 Message Date
Atsushi Eno 3e6f644393 Fix bug #9541 by Bart Verthé - do not reset document schema when reading an element. 2014-04-24 12:26:01 +09:00
Marek Safar d365718f2b Fix some API mismatch 2012-04-05 15:46:25 +01:00
Atsushi Eno 106e52d9ec Allow DocumentType in ImportNode().
http://lists.ximian.com/pipermail/mono-devel-list/2011-May/037575.html
2011-05-19 13:15:46 +09:00
Atsushi Eno adf9e99a21 XmlDocument.InnerText is overriden to explicitly throw IOE in 4.0. 2010-10-18 21:04:02 +09:00
Atsushi Eno dc3a99c440 2010-06-14 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : do not create XmlSchemaInfo instance every time
	  it validates a node.

	* XmlSchemaValidator.cs : limit validity initialization. In some
	  cases it failed to set Invalid.


svn path=/trunk/mcs/; revision=158867
2010-06-14 07:35:04 +00:00
Atsushi Eno f23c8f7fc2 2010-04-28 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : it seems .net does allow Load() with such an xml
	  reader positioned in the middle of the document. Fixed bug #598953.

	* XmlDocumentTests.cs : add test for bug #598953.


svn path=/trunk/mcs/; revision=156278
2010-04-28 01:22:00 +00:00
Atsushi Eno eb13491be6 2010-01-22 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : fix type check for optimal node creation.
	  Fixed bug #571336, #571226 and #572738.


svn path=/trunk/mcs/; revision=150041
2010-01-22 06:17:10 +00:00
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 b72c134a48 2008-09-24 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : it returns non-null Schemas by default (and
	  returns non-empty set after being set null).


svn path=/trunk/mcs/; revision=113958
2008-09-24 13:49:20 +00:00
Atsushi Eno 57b933955b 2008-09-10 Atsushi Enomoto <[email protected]>
* XmlDocument.cs, XmlDocumentNavigator.cs :
          reduce navigator fields.


svn path=/trunk/mcs/; revision=112645
2008-09-10 08:24:55 +00:00
Atsushi Eno caea8c9e44 2008-02-19 Atsushi Enomoto <[email protected]>
* XmlParserContext.cs : .net does not populate XmlNamespaceManager
	  automatically.
	* XmlDocument.cs : so, always create one here.

	* XmlParserContextTests.cs : they are working. case #3 should not
	  try to parse broken internalSubset (we do not allow broken
	  intsubset and it is almost no worthy of assuring only-nominal
	  .net compat that such broken internalSubset should be allowed).


svn path=/trunk/mcs/; revision=96116
2008-02-19 05:33:38 +00:00
Atsushi Eno 6c8f6ac907 2006-12-11 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : call overriden CreateAttribute() when loading from
	  XmlReader.

	* XmlDocumentTests.cs : make sure to call overriden CreateAttribute()
	  when loading from XmlReader.


svn path=/trunk/mcs/; revision=69290
2006-12-11 02:37:59 +00:00
Atsushi Eno c5064307cb 2006-08-26 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : use XmlValidatingReader to load TextReader/Stream
	  so that it could fill default and fixed attributes. This ends up
	  to fix bug #79163 (it fills fixed "xmlns" attribute and thus
	  the node's namespace URI becomes that of glade-2.0).

	* XmlDocumentTests.cs : added test for bug #79163.


svn path=/trunk/mcs/; revision=64413
2006-08-26 16:53:41 +00:00
Geoff Norton 9f3e358a8b 2006-04-27 Geoff Norton <[email protected]>
* XmlDocument.cs: Move back to the element after
        reading an attribute.  This mimics Microsofts behaviour.


svn path=/trunk/mcs/; revision=60005
2006-04-27 19:04:56 +00:00
Atsushi Eno 8f65945ebe 2006-02-21 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : (ReadNodeCore) not public.


svn path=/trunk/mcs/; revision=57102
2006-02-21 19:35:19 +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 0ef60eab7a 2006-02-16 Atsushi Enomoto <[email protected]>
* XmlDocument.cs XmlTextReader.cs : in ReadNode(), we can avoid
	  extraneous whitespace node creation for XmlTextReader by setting
	  WhitespaceHandling.Significant when PreserveWhitespace is false.


svn path=/trunk/mcs/; revision=56918
2006-02-16 10:30:13 +00:00
Atsushi Eno 4f249deb76 2006-02-03 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : reverted most of the previous changes. It somehow
	  broke System.Data tests.


svn path=/trunk/mcs/; revision=56519
2006-02-03 12:39:02 +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 de0937aac0 2006-01-28 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : in ReadNode() to consume element node, switched
	  to MoveToAttribute(int) since MoveToNextAttribute() was somehow
	  not working fine. It is needed to avoid Sys.Data test breakage
	  and anything else should be fixed indeed.


svn path=/trunk/mcs/; revision=56199
2006-01-28 07:03:20 +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 ca8695d941 2006-01-27 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : optimized ReadAttributeNode() to not call
	  MoveToAttribute() unneccesarily (call it only when ReadNode() is
	  called on an attribute node).


svn path=/trunk/mcs/; revision=56150
2006-01-27 08:06:49 +00:00
Atsushi Eno 3e22b34ec4 2006-01-24 Atsushi Enomoto <[email protected]>
* XmlNameEntryCache.cs XmlNameEntry.cs XmlDocument.cs :
	  Add Hash field to find name entry quickly.
	  In XmlNameEntryCache make use of name table (it is totally
	  unused there though).


svn path=/trunk/mcs/; revision=55970
2006-01-24 05:42:16 +00:00
Atsushi Eno 9546c7879c 2005-12-14 Atsushi Enomoto <[email protected]>
* XPathEditableDocument.cs : added 2.0 SchemaInfo.

	* XmlDocument.cs : changed some exception types.
	* XmlDocumentNavigator.cs : added 2.0 SchemaInfo.


svn path=/trunk/mcs/; revision=54344
2005-12-14 06:52:29 +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 f50bd018f8 2005-10-01 Atsushi Enomoto <[email protected]>
* XmlAttribute.cs, XmlDocument.cs : check id table updates when
	  XmlAttribute.set_Value() was invoked. Fixed bug #76311.

	* XmlAttributeTests.cs : test for bug #76311.


svn path=/trunk/mcs/; revision=51080
2005-10-01 18:34:38 +00:00
Atsushi Eno ccef6c8982 2005-09-25 Atsushi Enomoto <[email protected]>
* XmlSchemaValidationFlags.cs, XmlSchemaValidator.cs :
	  NET_2_0 API updates.

	* XmlReader.cs, XmlReaderSettings.cs, XmlDocument.cs:
	  XmlSchemaValidationFlags updates.

	* XmlSchemaValidatingReader.cs: XmlSchemaValidationFlags updates.

	* XmlReaderSettingsTests.cs : XmlSchemaValidationFlags NET_2_0 update.


svn path=/trunk/mcs/; revision=50732
2005-09-25 17:43:39 +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
Sebastien Pouliot a17dea8630 2005-08-31 Sebastien Pouliot <[email protected]>
* XmlDocument.cs: Added an InheritanceDemand for Unrestricted on 
	CreateDocumentType and ReadNode methods.
	* XmlException.cs: Added a Demand for SerializationFormatter on 
	GetObjectData method.
	* XmlResolver.cs: Added an InheritanceDemand for Unrestricted on 
	ResolveUri method.
	* XmlSecureResolver.cs: Fixed exception when creating evidences with 
	an empty URL in CreateEvidenceForUrl method. Only call ResolvePolicy 
	and PermitOnly if the security manager is enabled.
	* XmlTextReader.cs: Added an InheritanceDemand for Unrestricted on the
	class.
	* XmlTextReader2.cs: Added an InheritanceDemand for Unrestricted on 
	the class.
	* XmlValidatingReader.cs: Added an InheritanceDemand for Unrestricted 
	on the class.


svn path=/trunk/mcs/; revision=49179
2005-08-31 13:12:47 +00:00
Raja R Harinath 5942f52d09 Standardize line-endings in files (if most of the file is CRLF,
convert the whole thing to CRLF).  Set svn:eol-style native for 
files with LF line-endings.  Remove svn:executable.


svn path=/trunk/mcs/; revision=46117
2005-06-17 06:39:43 +00:00
Atsushi Eno b074c39916 2005-03-07 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : ugh, so I introduced extraneous reader.Read() in
	  ReadNode() for EntityReference and it resulted in unexpected skip.
	* DTDValidatingReader.cs : On EndEntity, LocalName and Name should
	  return the name of entity. Removed unused entityReaderNameStack.


svn path=/trunk/mcs/; revision=41533
2005-03-07 17:12:00 +00:00
Atsushi Eno 11d67c1519 2005-03-03 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : In ReadNode(), on EntityReference node, when 
	  XmlReader can resolve entity, it expands entity and apppend 
	  children into the entity reference. Patch by Konstantin Triger.


svn path=/trunk/mcs/; revision=41425
2005-03-04 05:41:14 +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 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 71008c0e66 2004-11-08 Atsushi Enomoto <[email protected]>
* XmlAttribute.cs, XmlElement.cs : get_Name should consider name table.
	* XmlDocument.cs : use NameTable in Load() and LoadXml().
	* XmlReader.cs : In Create(), use NameTable in XmlReaderSettings.

svn path=/trunk/mcs/; revision=35808
2004-11-08 06:32:35 +00:00
Atsushi Eno b248901394 2004-10-29 Atsushi Enomoto <[email protected]>
* XmlDocument.cs, XmlNodeReader.cs, XmlTextReader.cs,
	  XmlValidatingReader.cs : Those readers could just implement internal
	  interface IHasXmlParserContext.
	* XmlTextReader.cs, XmlValidatingReader.cs : this[] disappeared in 2.0.
	  (XmlReader has them as virtual.)
	* XmlReader.cs : ReadAsObject() disappeared.
	* XmlWriter.cs : WriteFromObject() disappeared.

svn path=/trunk/mcs/; revision=35417
2004-10-29 01:20:48 +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 65c290bee7 2004-10-28 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : XPathEditableDocument looks broken. Just reverted
	  to fix 2.0 corcompare.

svn path=/trunk/mcs/; revision=35375
2004-10-28 01:26:49 +00:00
Atsushi Eno 917d013209 2004-10-22 Atsushi Enomoto <[email protected]>
* XmlDocument.cs :
	  For net_2_0, CreateNavigator() returns editable XPathNavigator.
	* XmlReader.cs, XmlTextReader.cs, XmlValidatingReader.cs :
	  They do not implement IXmlDataEvidence anymore.

svn path=/trunk/mcs/; revision=35268
2004-10-22 19:57:04 +00:00
Atsushi Eno 0562042171 2004-08-03 Atsushi Enomoto <[email protected]>
* XmlCharacterData.cs,
	  XmlDocument.cs,
	  XmlNodeChangedEventArgs.cs :
	  Implemented XmlNodeChangedEventArgs.OldValue and .NewValue.

svn path=/trunk/mcs/; revision=31791
2004-08-03 11:52:49 +00:00
Atsushi Eno 69821227f0 2004-06-27 Atsushi Enomoto <[email protected]>
* XmlDocument.cs:
	  Close XmlReader only when it is created. This fixes bug #60809.

svn path=/trunk/mcs/; revision=30471
2004-06-28 02:00:58 +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 c818d765cf 2004-06-06 Atsushi Enomoto <[email protected]>
* DTDObjectModel.cs,
	  XmlDocument.cs : Close stream always.
	* XmlNodeReader.cs : don't expect atomized name in LookupNamespace().
	* XmlTextReader.cs : Namespace has was not done. Some tests depends on
	  this failure and to be fixed.

svn path=/trunk/mcs/; revision=28900
2004-06-06 07:32:59 +00:00
Atsushi Eno 00781b75f7 2004-05-27 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : Save() should indent only when PreserveWhitespace
	  is false. Fixed bug #59155.
	  Modified comment lines a bit.

svn path=/trunk/mcs/; revision=28234
2004-05-27 08:22:09 +00:00
Atsushi Eno 4190429496 2004-05-12 Atsushi Enomoto <[email protected]>
* DTDObjectModel.cs,
	  DTDReader.cs,
	  XmlDocument.cs,
	  XmlInputStream.cs,
	  XmlParserInput.cs,
	  XmlTextReader.cs,
	  XmlUrlResolver.cs : removed reference to Mono.Xml.
	  Made Mono.Xml.* classes internal.
	* XmlDocument.cs : output xml declaration for TextWriter output in Save()
	* XmlElement.cs : Name character check should be done in .ctor().
	* XmlNamespaceManager.cs : Removed dangerous internal .ctor()

svn path=/trunk/mcs/; revision=27149
2004-05-12 09:11:19 +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 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