37 Commits
Author SHA1 Message Date
Marek Safar d19e5c42a5 [System.Xml] Update supported time formats for mobile version of XML deserializer. Fixes #42843 2016-10-14 09:10:17 +02:00
Zoltan Varga 0985d4aa4b [bcl] Remove NET_2_0 defines from the class libs. This has been done using: unifdef -t -DNET_2_0 -o <filename> <filename>. 2015-01-13 15:29:38 -05:00
Lluis Sanchez aabbc960b7 Improve date serialization compatibility with third party web services
Make XmlCustomFormatter.cs more liberal about the date formats it accepts.
Many third party web services do not format date exactly at 'yyyy-mm-dd'.
The Microsoft implementation is more liberal about accepting other formats
and so the current Mono implementation breaks projects that consume third
party web services when they are ported to Mono.
Based on a patch by Aaron Roydhouse.
2012-06-05 12:35:52 +02:00
Sebastien Pouliot 4925054bb0 Make some S.X.S types compatible with the SL API (for SDK)
* XmlAnyElementAttributes.cs:
* XmlArrayItemAttributes.cs:
* XmlElementAttributes.cs:
	Under Silverlight API this implement IList only (does not
inherit from CollectionBase).

* XmlCustomFormatter.cs:
* XmlSerializationWriterInterpreter.cs:
	Use a Convert.ChangeType override that exists in SL API

* XmlReflectionImporter.cs: Provide an alternative for (missing in SL)
Enum.GetNames and select available (in SL) overloads for parsing and
formatting for enums

* XmlSerializationReader.cs: Fix ToEnum API to use IDictionary (in SL)
instead of Hashtable (even if the SL4 docs still states the later)

* XmlSerializationReaderInterpreter.cs:
* XmlTypeMapping.cs:
	Use the default (identical to nonPublic being false) when using
	Activator.CreateInstance under SL

* XmlSerializationWriter.cs: Internally use a Queue<T> instead a a Queue
(not available in SL). Also Namespaces (ArrayList) is replaced by
XmlNamespaces (IList) in SL API.

* XmlSerializer.cs: Do not use environment variables in MOONLIGHT (like
the rest of MOBILE). Use Encoding.UTF8 instead of ENcoding.Default since
the later does not exist in SL.

* XmlSerializerImplementation.cs: SL version use IDictionary instead of
Hashtable for properties.

* XmlSerializerNamespaces.cs: Internally use a generic Dictionary
* instead
of a ListDictionary (which is not available in SL)
2011-05-06 08:40:41 -04:00
Atsushi Eno 756ab6c79b 2007-10-30 Atsushi Enomoto <[email protected]>
* XmlConvert.cs : ToDateTime(string,string) should use ParseExact(),
	  not Parse(). Use 'K' for roundtrip format.

	* XmlCustomFormatter.cs : use RoundtripKind when converting to and
	  from DateTime.

	* XmlConvertTest.cs : added test for DateTime roundtrip.

	* XmlSerializerTests.cs : added test for bug #337729.


svn path=/trunk/mcs/; revision=88448
2007-10-30 12:33:34 +00:00
Atsushi Eno 3ed900c939 2007-10-26 Atsushi Enomoto <[email protected]>
* TypeTranslator.cs, XmlCustomFormatter.cs : looks like duration is
	  serialized to System.String, not TimeSpan. Fixed bug #336625.

	* XmlSerializerTests.cs : added test for DataType in [XmlElement].


svn path=/trunk/mcs/; revision=88247
2007-10-26 04:00:22 +00:00
Atsushi Eno 044e2c1ec4 2007-04-25 Atsushi Enomoto <[email protected]>
* XmlConvert.cs : MinValue and MaxValue are unchanged by the
	  serialization mode (unlike DateTime.ToString()).

	* XmlCustomFormatter.cs : fix GenerateToXmlString() as well.

	* XmlConvertTests.cs : added test for MaxValue serialization with
	  every XmlDateTimeSerializationMode.


svn path=/trunk/mcs/; revision=76275
2007-04-25 19:31:47 +00:00
Atsushi Eno a1cc211652 2007-04-25 Atsushi Enomoto <[email protected]>
* XmlConvert.cs : in 2.0, use F instead of f in dateTime formatting.

	* XmlCustomFormatter.cs :
	  in 2.0, use F instead of f for dateTime formatting.

	* XmlSerializationWriterTests.cs, XmlSerializerTests.cs :
	  fixed wrong dateTime formatting tests.


svn path=/trunk/mcs/; revision=76268
2007-04-25 18:22:32 +00:00
Atsushi Eno 539a09ff94 2007-04-24 Atsushi Enomoto <[email protected]>
* XmlCustomFormatter.cs : ditto for reader method generation.
	* SerializationCodeGenerator.cs : for generic nullable values it
	  needs to store ReadNullableString() result to a temporary variable.

	* XmlSerializerTests.cs : another case on #80759 from gert.


svn path=/trunk/mcs/; revision=76160
2007-04-24 03:37:03 +00:00
Atsushi Eno 4d3d5288a1 2007-04-23 Atsushi Enomoto <[email protected]>
* TypeData.cs, XmlCustomFormatter.cs : generic nullable values did
	  not fit with non-nullable formatting. Fixed #80759 regression.

	* XmlSerializerTests.cs :
	  added missing test from 80759, and marked similar but different one
	  from the same bug as not working.


svn path=/trunk/mcs/; revision=76099
2007-04-23 08:41:41 +00:00
Atsushi Eno 4b62022259 2006-12-04 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs, XmlCustomFormatter.cs :
	  GenerateToXmlString() needed hexBinary support as well. Since
	  XmlConvert.[To|From]BinHexString() are internal, use reflection.
	  Really fixed bug #79989 and #79990 for generated serializers.

	* XmlSerializerTests.cs :
	  added base64 tests which is similar to hexBinary.


svn path=/trunk/mcs/; revision=68927
2006-12-04 05:21:02 +00:00
Atsushi Eno a864cdb5fd 2006-11-22 Atsushi Enomoto <[email protected]>
* XmlCustomFormatter.cs : handle hexBinary type. Fixed bug #79989
	  and #79990.

	* XmlSerializerTests.cs : added test for hexBinary.


svn path=/trunk/mcs/; revision=68351
2006-11-22 14:17:49 +00:00
Atsushi Eno 70273cd0f3 2006-11-07 Atsushi Enomoto <[email protected]>
* XmlCustomFormatter.cs : consider null base64 byte array value.
	  Fixed bug #79805.


svn path=/trunk/mcs/; revision=67476
2006-11-07 18:21:49 +00:00
Gert Driesen fe34bc872c * XmlSerializationWriterTests.cs: Use Assert instead of deprecated
Assertion class. Added tests for FromEnum, WriteXsiType, 
WriteTypedPrimitive and WritePotentiallyReferencingElement. Changed
accessibility of Reset and Content on XmlSerializationWriterTester
and added public Execute methods for WritePotentiallyReferencingElement
and WriteTypedPrimitive, to allow this class to be useful for tests
that have effect on the prefix for other tests.
* XmlSerializationReaderTests.cs: Added tests for ToEnum.
* System.Xml_test.dll.Sources: Added XmlSerializationReaderTests.cs.
* XmlSerializationWriter.cs: Implemented 2.0 version of FromEnum, and
CreateInvalidEnumValueException. Set eol-style to native.
* XmlCustomerFormatter.cs: Added FromEnum overload that takes name of
enum for which string value must be created. Set eol-style to native.
Modified FromEnum to behave more like MSFT's implementation:
- treat value as bit field.
- no longer return empty string if the value matches an id for which there's 
no corresponding name.
- if one of the ids has value 0 and there's a match for the enum value
(with a zero length XML name) or the enum value is 0, then return the 
corresponding XML for the id with value 0.
- in 2.0 profile, throw InvalidOperationException if no match is found
for (part of) the enum value.
Modifies ToEnum to match the MSFT implementation (as described in
.NET 2.0 SDK):
- Expect hashtable containing enum names as key, and corresponding
integral numbers as value.
- Do not report exception for whitespace-only value.
- Support space (MS docs are not clear about this) delimited list 
of names.
- typeName is only used to construct exception message.

svn path=/trunk/mcs/; revision=56700
2006-02-09 13:30:02 +00:00
Lluis Sanchez 3229b25fc8 2005-07-01 Lluis Sanchez Gual <[email protected]>
* XmlCustomFormatter.cs: Properly read/write duration values.


svn path=/trunk/mcs/; revision=46853
2005-07-01 18:41:37 +00:00
Lluis Sanchez 1b6cb3b0ad * TypeTranslator.cs, XmlCustomFormatter.cs: Added support for base64. This
xsd type is not part of the last schema specification, but the google api
	  uses it and ms.net accepts it.

svn path=/trunk/mcs/; revision=31167
2004-07-15 09:13:12 +00:00
Lluis Sanchez 9b8f2df735 * SerializationCodeGenerator.cs: Generate check that the object being
serialized has a known type. Little cast fix.
	* XmlCustomFormatter.cs: Little fix in Single conversion.

svn path=/trunk/mcs/; revision=30669
2004-07-02 13:59:56 +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 a5eaabf6f1 2004-06-18 Atsushi Enomoto <[email protected]>
* CodeIdentifier.cs, CodeIdentifiers.cs, MapCodeGenerator.cs,
	  SerializationCodeGenerator.cs, SerializationSource.cs,
	  TypeTranslator.cs, XmlAttributeOverrides.cs, XmlCustomFormatter.cs,
	  XmlSerializationReader.cs, XmlSerializationWriter.cs,
	  XmlSerializer.cs, XmlTypeMapMemberElement.cs, XmlTypeMapping.cs
	  : Globalization fixes.
	    In XmlCustomFormatter.GenerateToXmlString() time was not
	    generated correctly.
	    Replaced all CRLF XmlAttributeOverrides.cs into LF.

svn path=/trunk/mcs/; revision=29865
2004-06-18 09:50:34 +00:00
Lluis Sanchez ef8f047dbe * TypeTranslator.cs, XmlCustomFormatter.cs: Removed map from Uri to anyUri,
not present in MS.NET.
	* XmlSerializationWriter.cs: Improved error message.

svn path=/trunk/mcs/; revision=25465
2004-04-14 11:33:19 +00:00
Lluis Sanchez a303d9ab6f * SerializationCodeGenerator.cs: Several fixes: generate valid names for
WriteRoot_ and ReadRoot_ methods. Cast result of ReadTypedPrimitive to
	  the adequate type. Set the default value of members that do have a default
	  value. Other minor fixes.
	* SoapReflectionImporter.cs, XmlReflectionImporter.cs: All maps must derive
	  from typeof(object) map, even those that have another base class.
	* XmlCustomFormatter.cs: Fixed generation of conversion from char to string.
	  It must serialize the char as number, not as character.
	* XmlSerializationReaderInterpreter.cs: Set the default value of members
	  that do have a default value.
	* XmlTypeMapping.cs: Added property MembersWithDefault, which returns a list
	  of members that have a default value.

svn path=/trunk/mcs/; revision=24540
2004-03-24 19:30:12 +00:00
Lluis Sanchez 95d2d48bb3 * SerializationCodeGenerator.cs: Added support for generation of readers
and writers for several maps in a single class. Added support for
	  XmlMemberMapping. Fixed generation of serializers that use encoded format.
	* SoapAttributeAttribute.cs, SoapAttributeOverrides.cs, SoapAttributes.cs,
	  SoapElementAttribute.cs, SoapEnumAttribute.cs, SoapTypeAttribute.cs,
	  XmlAnyElementAttribute.cs, XmlAnyElementAttributes.cs, XmlArrayAttribute.cs,
	  XmlArrayItemAttribute.cs, XmlArrayItemAttributes.cs, XmlAttributeAttribute.cs,
	  XmlAttributeOverrides.cs, XmlChoiceIdentifierAttribute.cs, XmlRootAttribute.cs,
	  XmlElementAttribute.cs, XmlElementAttributes.cs, XmlEnumAttribute.cs,
	  XmlReflectionMember.cs, XmlTextAttribute.cs, XmlTypeAttribute.cs:
	  Added InternalEquals method.
	* XmlAttributes.cs: Removed a lot of unused code. Added InternalEquals method.
	* SoapReflectionImporter.cs: Set SerializationSource to generated maps.
	* XmlCustomFormatter.cs: Fixed little bug.
	* XmlMapping.cs: Added Source property. This a global identifier of the map.
	* XmlReflectionImporter.cs: Set SerializationSource to generated maps.
	* XmlSchemaImporter.cs: Set the correct value for IsNillable when importing
	  mapping members.
	* XmlSerializationReaderInterpreter.cs, XmlSerializationWriter.cs: Minor fixes.
	* XmlSerializationWriterInterpreter.cs: WriteObject and WriteEnum were not
	  correctly used.
	* XmlSerializer.cs: Added support for generation of serializers.

svn path=/trunk/mcs/; revision=23392
2004-02-24 12:03:28 +00:00
Lluis Sanchez af31a18a06 * MapCodeGenerator.cs: Modified some methods to make them easier to reuse.
Those are basically methods to add custom attributes to element and
	  attribute members.
	* SoapCodeExporter.cs: Track changes in MapCodeGenerator.
	* XmlCodeExporter.cs: Better support for custom attribute generation for
	  method parameters.
	* XmlCustomFormatter.cs: Added null check.
	* XmlSchemaImporter.cs: do not set IsOptionalValueType property to
	  attributes that are required.
	* XmlSerializationReaderInterpreter.cs: Method parameters may be serialized
	  as attributes.

svn path=/trunk/mcs/; revision=23131
2004-02-16 15:40:15 +00:00
Lluis Sanchez 5effdc6dca * TypeTranslator.cs, XmlCustomFormatter.cs: Added support for the
normalizedString schema type.

svn path=/trunk/mcs/; revision=22902
2004-02-09 15:38:30 +00:00
Lluis Sanchez 1ddd1b45ea * XmlCustomFormatter.cs: Added support for anyUri type. This fixes
bug #50041.

svn path=/trunk/mcs/; revision=19598
2003-11-03 21:23:48 +00:00
Lluis Sanchez d33e81ef0a * XmlCustomFormatter.cs: added support for additional string types in
GenerateToXmlString().
	* XmlSchemaExporter.cs: Fixed generation of XmlMembersMapping using
	  encoded format.

svn path=/trunk/mcs/; revision=18085
2003-09-14 13:08:11 +00:00
Lluis Sanchez 1f9698d02a * XmlSchemaImporter.cs: Implemented ImportMembersMapping.
* XmlTypeMapMemberElement.cs: Little fix.
	* XmlTypeMapping.cs: Added AllElementInfos property in ClassMap.
	* XmlCustomFormatter.cs: Added GenerateToXmlString and GenerateFromXmlString
	  methods.
	* SerializationCodeGenerator.cs, SerializationCodeGeneratorConfiguration.cs:
	  Added.

svn path=/trunk/mcs/; revision=17792
2003-09-01 14:13:23 +00:00
Lluis Sanchez 0fb5c9e6e7 * SoapReflectionImporter.cs: Fix support for DataType in class members.
* TypeData.cs: Don't use "Index" name to get indexer property. Indexer properties
	  can have other names.
	* TypeTranslator.cs, XmlCustomFormatter.cs: Added support for "time" and "data" xml types.
	* XmlReflectionImporter.cs, XmlTypeMapElementInfo.cs, XmlSerializationReader.cs,
	  XmlSerializationWriter.cs, XmlTypeMapElementInfo.cs, XmlTypeMapping.cs:
	  Fix support for DataType in class members.
	* XmlSerializationReaderInterpreter.cs, XmlSerializationWriterInterpreter.cs:
	  Added support for array of primitive types in attributes.

svn path=/trunk/mcs/; revision=15791
2003-06-30 21:13:56 +00:00
Lluis Sanchez 64f5b2fde7 * SoapReflectionImporter.cs: Added check: some overrides cannot be applied to primitive types.
* XmlAttributes.cs: Default value of XmlDefaultValue changed to System.DBNull.Value
	* XmlCustomFormatter.cs: small fixes.
	* XmlReflectionImporter.cs: Added check: some overrides cannot be applied to primitive types.
	* XmlSerializationWriter.cs: Implemented TopLevelElement().
	  WriteNamespaceDeclarations(): Fixed (the hashtable contains XmlQualifiedNames, not strings).
	  WriteXsiType(): It is not necessary to add the namespace declaration, this will now be done by XmlWriter.
	* XmlSerializationWriterInterpreter.cs: Call TopLevelElement() when writing classes or arrays as
	  root elements.

svn path=/trunk/mcs/; revision=15288
2003-06-10 18:30:32 +00:00
Lluis Sanchez 2ce77c20e0 * TypeData.cs, TypeTranslator.cs: Added support for enums. Added method for translating
from xml type to clr type.
	* XmlCustomFormatter.cs: Fixed bug in serialization of chars. Support for byte[].
	* XmlReflectionMember.cs: Added default constructor.
	* XmlSerializationReader.cs: Implemented ReadTypedPrimitive(), ToByteArrayBase64().
	* XmlSerializationWriter.cs: Several fixes.
	* XmlSerializationReaderInterpreter.cs, XmlReflectionImporter.cs, XmlSerializationWriterInterpreter.cs
	  XmlTypeMapMember.cs, XmlTypeMapMemberElement.cs, XmlTypeMapping.cs:
	  Added support for enums. Added support for XmlElement and XmlNode.
	  Support for XmlAnyAttributeAttribute and XmlAnyElementAttribute. Many fixes.

svn path=/trunk/mcs/; revision=14977
2003-05-28 22:30:06 +00:00
Lluis Sanchez 63d68c4130 * TypeData.cs, TypeTranslator.cs: Implemented some methods.
* XmlCustomFormatter.cs: Added formatting methods.
	* XmlReflectionImporter.cs, XmlSerializer.cs: New implementation.
	* XmlReflectionMember.cs: Added new constructor.
	* XmlSerializationReader.cs, XmlSerializationWriter.cs: Implemented some methods.
	* XmlSerializationWriterInterpreter.cs, XmlSerializationReaderInterpreter.cs
	  XmlTypeMapElementInfo.cs, XmlTypeMapMember.cs, XmlTypeMapMemberAttribute.cs
	  XmlTypeMapMemberElement.cs, XmlTypeMapping.cs: Added

svn path=/trunk/mcs/; revision=14884
2003-05-26 14:34:44 +00:00
Atsushi Eno 0ee09c9717 2003-05-05 Atsushi Enomoto <[email protected]>
* ChangeLog : Added missing ChangeLog of 2003-04-25.
	* XmlCustomFormatter.cs : Fixed FromXmlNmTokens() to contain
	  separators. Added experimental method ToEnum().
	* XmlSerializationReader.cs : unconfirmed implementation of
	  ReadSerializable() and ToEnum().
	* XmlSerializationWriter.cs : fixed WriteAttribute() so that if value
	  is null then no output will be written.
	  Fixed WriteStartElement(), WriteElement*() and WriteEmptyTag()
	  to use custom formatted name.

svn path=/trunk/mcs/; revision=14268
2003-05-04 19:48:24 +00:00
Miguel de Icaza b696ec6c57 2003-03-12 Elan Feingold <[email protected]>
* XmlCustomFormatter.cs: Correct signature, Implement
	ToByteArrayBase64

	* XmlSerializationWriter.cs: Fix prototype.

	* XmlSerializer.cs: Implements Deserialize().

2003-03-12  Elan Feingold <[email protected]>

	* XmlTextReader.cs: When throwing a ReaderException, show what
	character was the culprit

svn path=/trunk/mcs/; revision=12456
2003-03-12 05:43:46 +00:00
Gonzalo Paniagua Javier f9fcc1d75e 2002-09-19 Gonzalo Paniagua Javier <[email protected]>
* XmlCustomFormatter.cs: finished.
	* XmlSerializationReader.cs: implemented some more methods.

svn path=/trunk/mcs/; revision=7611
2002-09-19 07:16:01 +00:00
Tim Coleman a47aca07c9 2002-08-24 Tim Coleman <[email protected]>
* SoapCodeExporter.cs:
                Fix return value of ExportTypeMapping.
        * XmlCustomFormatter.cs:
                Change methods to be internal instead of public.
        * XmlSerializationWriter.cs:
                Modify GetPrimitiveTypeName to build on linux.
                Modify GetQualifiedName to return an incrementing prefix
                instead of the same one all the time (still need to manage
                conflicts)
                Modify WriteElementString to only do special stuff is XsiType
                is not defined.
                Modify WriteTypedPrimitive to use FromXmlQualifiedName if it's
                an XmlQualifiedName.

svn path=/trunk/mcs/; revision=7023
2002-08-25 05:16:40 +00:00
Tim Coleman e2f62c9a84 *** empty log message ***
svn path=/trunk/mcs/; revision=6923
2002-08-23 03:46:58 +00:00
Tim Coleman e9ad8331ab 2002-08-22 Tim Coleman <[email protected]>
* XmlSerializationWriter.cs:
                More implementation
        * XmlCustomFormatter.sc:
                Implemented this class.

svn path=/trunk/mcs/; revision=6897
2002-08-22 15:57:12 +00:00