Commit Graph
476 Commits
Author SHA1 Message Date
Atsushi Eno 8e6042d7e7 2007-01-19 Atsushi Enomoto <[email protected]>
* XmlMemberMapping.cs : uhoh, there is a nasty trick to output
	  Nullable info.

	* XmlSchemaImporterTests.cs :
	  Added ImportMembersMapping_NullableField().


svn path=/trunk/mcs/; revision=71318
2007-01-19 06:35:02 +00:00
Atsushi Eno c7f990160e 2007-01-18 Atsushi Enomoto <[email protected]>
* TypeData.cs : added get_IsGenericNullable.
	* MapCodeGenerator.cs : in GetDomType(), return Nullable<T> when
	  the TypeData.IsGenericNullable.
	  Use GetDomType() instead of CodeTypeReference.ctor() to not lose
	  Nullable<T> info.
	* XmlSchemaImporter.cs : added isNullable argument to GetTypeData()
	  so that it won't XmlSchemaElement.IsNillable.
	* TypeTranslator.cs :
	  Fixed wrong TypeData modification against non-nullable stuff.
	  Added another GetTypeData() that takes isNullableRuntimeType so
	  that it won't miss XmlSchemaElement.IsNillable.
	  Added another GetPrimitiveTypeData() that takes nullable.

	* XmlSchemaImporterTests.cs :
	  test that <xs:element nillable='true' ...> is mapped to Nullable<T>.


svn path=/trunk/mcs/; revision=71304
2007-01-18 18:00:36 +00:00
Atsushi Eno 11124928cd 2007-01-15 Atsushi Enomoto <[email protected]>
* TypeData.cs : reject generic type definitions.
	* TypeTranslator.cs : Make generic type names in XML compatible with
	  .net: foo_x0060_1 -> fooOfString.

	* XmlSerializerTests.cs : most of generic tests are working now.
	* XmlReflectionImporterTests.cs : test for rejecting generic type
	  definition.


svn path=/trunk/mcs/; revision=71001
2007-01-15 05:26:35 +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
Gert Driesen 0cee60a6a0 * XmlSchemaExporterTests.cs: Added tests for (part of) bug #78214.
* XmlSchemaExporter.cs: Emit xml name of enum-based default values.
Set XmlSchemaAttribute.Use to Required if no default value is defined,
and member is not an optional value type. Element should have minOccurs
1 if value type member has default value. Output flag enum type as
xsd list with restriction.
* XmlReflectionImporter.cs: Removed special casing of enums. Instead
of passing namespace of XmlAttribute to ImportTypeMapping, use the
default namespace for importing the member type.

svn path=/trunk/mcs/; revision=68887
2006-12-03 13:51:16 +00:00
Gert Driesen 5cab5ca519 * SerializationCodeGenerator.cs: Initialize out parameters if they
are value types. Fixed bug #79988.
* XmlSerializationReaderInterpreter.cs: Same.

svn path=/trunk/mcs/; revision=68877
2006-12-02 16:42:22 +00:00
Atsushi Eno 0180b11bb3 2006-12-01 Atsushi Enomoto <[email protected]>
* XmlReflectionImporter.cs : implemented several missing check and 
	  support for XmlArrayAttribute. Fixed bug #78042.

	* XmlSerializerTests.cs : added tests for XmlArrayAttribute support.


svn path=/trunk/mcs/; revision=68792
2006-12-01 01:44:17 +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 53fe340a95 2006-11-22 Atsushi Enomoto <[email protected]>
Fixed bug #78611.
	* TypeData.cs, TypeTranslator.cs: improved TypeData to actually store
	  "nullable" information. Introduced new primitiveNullableTypes pool
	  whose TypeData has 'true' for new IsNullable property. This
	  property is also used for non-primitive types.
	* XmlReflectionImporter.cs : there, use TypeData.IsNullable instead
	  of IsValueType, to handle nullable types.

	* XmlReflectionImporterTests.cs : added test for class that contains
	  nullable value type field whose XmlElementAttribute IsNullable.


svn path=/trunk/mcs/; revision=68341
2006-11-22 11:37:28 +00:00
Atsushi Eno 0c6fc352d6 2006-11-20 Atsushi Enomoto <[email protected]>
* TypeTranslator.cs : Hari knew better way to do it.


svn path=/trunk/mcs/; revision=68179
2006-11-20 09:35:43 +00:00
Atsushi Eno 7ae90aa118 2006-11-20 Atsushi Enomoto <[email protected]>
* TypeTranslator.cs : #if NET_2_0 for generic thingy.


svn path=/trunk/mcs/; revision=68177
2006-11-20 08:37:26 +00:00
Atsushi Eno b8757e8a2f 2006-11-20 Atsushi Enomoto <[email protected]>
* TypeTranslator.cs : (GetTypeData) when the argument type is
	  Nullable<T>, use T instead. At run time (on both interpreter and
	  generated code) it is converted to T. Fixed bug #79803.

	* XmlSerializerTests.cs : added test for nullable type.


svn path=/trunk/mcs/; revision=68175
2006-11-20 07:44:28 +00:00
Atsushi Eno b70585a3e8 2006-11-17 Atsushi Enomoto <[email protected]>
* XmlSerializerTests.cs : test for basic generic type support with
	  code generation.

	* SerializationCodeGenerator.cs, TypeData.cs :
	  Now we differentiate TypeName, FullTypeName C# type names. It is
	  to create valid C# sources especially for generic types.
	  Fixed bug #79657.


svn path=/trunk/mcs/; revision=68058
2006-11-17 14:52:02 +00:00
Atsushi Eno 848d3729d5 2006-11-17 Atsushi Enomoto <[email protected]>
* XmlSerializationReader.cs : (ReadReferencedElement)
	  Sometimes there are array types in WSDL, which are not reflected
	  in client proxies. In SOAP messages, they are marked
	  soap-env:arrayType, so use it (this could coexist with xsi:type,
	  which indicates the type in WSDL). Fixed bug #79057.


svn path=/trunk/mcs/; revision=68045
2006-11-17 02:21:56 +00:00
Atsushi Eno 645f666148 2006-11-15 Atsushi Enomoto <[email protected]>
* XmlSerializationReader.cs : implement ToByteArray[Base64|Hex]().
	  removed extra ReadSerializable().
	* XmlTypeMapping.cs : added XsdTypeName and XsdTypeNamespace.


svn path=/trunk/mcs/; revision=67904
2006-11-15 12:38:09 +00:00
Atsushi Eno 1d3440fc5d sanitizing MonoTODOs.
svn path=/trunk/mcs/; revision=67899
2006-11-15 11:31:25 +00:00
Atsushi Eno ec31a7936d 2006-11-14 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs,
	  SerializationCodeGeneratorConfiguration.cs :
	  make "XmlSerializerContract" and "BaseXmlSerializer" customizible.
	  (or it is impossible to use genxs more than twice in an assembly.)

	* XmlSerializerImplementationTests.cs :
	  another custom implementation case.


svn path=/trunk/mcs/; revision=67857
2006-11-14 17:36:49 +00:00
Atsushi Eno 96a0854809 2006-11-10 Atsushi Enomoto <[email protected]>
Fixed bug #77117.
	* XmlReflectionImporter.cs : Compute nullable correctly. Elements are
	  nillable when its type is a reference type.
	* XmlSchemaExporter.cs :
	  Set XmlTypeMapElementInfo.IsNullable from XmlTypeMapping.
	  Set XmlSchemaElement.IsNillable from XmlTypeMapElementInfo.

	* XmlSchemaExporterTests.cs :
	  fixed almost all test cases which expected totally wrong schemas.
	  Schema elements are all nillable unless it is of value type.


svn path=/trunk/mcs/; revision=67662
2006-11-10 10:01:59 +00:00
Atsushi Eno 0640f1f47f 2006-11-09 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : top-level element might also have no type
	  name specification, so just compare ElementType with anyType.

	* XmlSchemaImporterTests.cs :
	  added DefaultTypeTopLevelElementImportsAllComplexTypes().


svn path=/trunk/mcs/; revision=67595
2006-11-09 14:36:01 +00:00
Atsushi Eno 41f534fdfb 2006-11-09 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : attributes might overlap by extending
	  base content models. Since invalid content models are rejected by
	  Compile(), simply ignore duplicating attributes. Note that it is
	  basically hack, which should not skip derived ones but use them (but
	  it is mostly harmless since the result is very unlikely to differ).

	* XmlSchemaImporterTests.cs :
	  added ImportComplexDerivationByExtension().


svn path=/trunk/mcs/; revision=67581
2006-11-09 09:07:40 +00:00
Atsushi Eno 048ea0257a 2006-11-08 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : when top-level element is xs:anyType, all
	  complexTypes must be also imported.

	* XmlSchemaImporterTests.cs :
	  added AnyTypeTopLevelElementImportsAllComplexTypes().


svn path=/trunk/mcs/; revision=67569
2006-11-09 04:23:05 +00:00
Atsushi Eno b47effcc21 2006-11-08 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : ImportTypeMapping() raises exception when
	  the argument name is not bound to any elements.

	* XmlSchemaImporterTests.cs : added ImportTypeMapping() test for
	  nonexistent name.


svn path=/trunk/mcs/; revision=67560
2006-11-09 02:11:40 +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
Atsushi Eno 112c1993e5 eol-style:native
svn path=/trunk/mcs/; revision=67475
2006-11-07 18:19:47 +00:00
Atsushi Eno 987f8c63e2 merge r67228-r67235, r67237, r67251 and r67256-67259 to trunk (they are
non-breaking parts yet).

svn path=/trunk/mcs/; revision=67473
2006-11-07 18:14:55 +00:00
Atsushi Eno 3240603b89 2006-11-02 Atsushi Enomoto <[email protected]>
* CodeIdentifier.cs : in 2.0 profile, .ctor() is exposed to
	  explicitly say Obsolete instantiation.
	* CodeIdentifiers.cs : implemented case-insensitive mode.
	* XmlSerializerAssemblyAttribute.cs : added missing .ctor().
	* SoapIncludeAttribute.cs, XmlIncludeAttribute.cs :
	  in 2.0 profile it could also be applied to an interface.
	* SoapReflectionImporter.cs,
	  XmlReflectionImporter.cs,
	  XmlMappingAccess.cs :
	  added missing ImportMembersMapping overload and moved actual
	  implementation to most lengthy-arglist one. To make it possible,
	  XmlMappingAccess is included in 1.x as internal enum.


svn path=/branches/atsushi/mcs/; revision=67256
2006-11-02 07:58:54 +00:00
Atsushi Eno c6b89558b4 2006-11-02 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : initialize extensions from configuration.


svn path=/branches/atsushi/mcs/; revision=67251
2006-11-02 01:50:30 +00:00
Atsushi Eno 658311053b eol-style:native
svn path=/branches/atsushi/mcs/; revision=67237
2006-11-01 20:12:00 +00:00
Atsushi Eno 732496f334 2006-11-01 Atsushi Enomoto <[email protected]>
* Makefile : Now it supports (and expects) cyclic build. You need
	  another System.XML iteration in mcs/class/Makefile.
	* System.Xml.dll.sources : moved extension classes, added config and
	  XmlSchemaEnumerator.cs and removed IXmlSerializerImplementation.cs.


svn path=/branches/atsushi/mcs/; revision=67234
2006-11-01 20:02:15 +00:00
Atsushi Eno b59644a293 as well :p
svn path=/branches/atsushi/mcs/; revision=67233
2006-11-01 19:57:19 +00:00
Atsushi Eno 8db245f202 2006-11-01 Atsushi Enomoto <[email protected]>
* XmlSerializationGeneratedCode.cs : removed InternalSyncObject.
	* SerializationCodeGenerator.cs : since IXmlSerializerImplementation
	  became a class, it needs explicit "override".
	  Since InternalSyncObject is gone, it needs another lock target.
	* IXmlSerializerImplementation.cs : removed.
	* XmlSerializerImplementation.cs : added.
	* XmlSerializer.cs : removed extra GenerateSerializer() overloads.
	  IXmlSerializerImplementation -> XmlSerializerImplementation.
	* XmlSchemas.cs : removed Schemas. hacked Compile().
	  Now it implements IEnumerable<XmlSchema>.
	* XmlSchemaEnumerator.cs : added missing type.


svn path=/branches/atsushi/mcs/; revision=67230
2006-11-01 19:52:06 +00:00
Atsushi Eno 42ddd7a0cd 2006-11-01 Atsushi Enomoto <[email protected]>
* XmlAttributeEventArgs.cs : added ExpectedAttributes. Note that it
	  is not considered in XmlSerializationReader yet.
	* XmlElementEventArgs.cs : added ExpectedElements. Note that it
	  is not considered in XmlSerializationReader yet.
	* XmlSerializationReader.cs : added some overloads for 
	  UnknownElement()/-Attribute()/-Node().


svn path=/branches/atsushi/mcs/; revision=67229
2006-11-01 19:46:55 +00:00
Atsushi Eno 803b5ed83b 2006-11-01 Atsushi Enomoto <[email protected]>
* CodeGenerationOptions.cs : [XmlEnum], [XmlIgnore] and
	  [Serializable].
	* XmlSerializationCollectionFixupCallback.cs,
	  XmlNodeEventHandler.cs,
	  XmlSerializationReadCallback.cs,
	  UnreferencedObjectEventHandler.cs,
	  XmlSerializationWriteCallback.cs,
	  XmlAttributeEventHandler.cs,
	  XmlElementEventHandler.cs,
	  XmlSerializationFixupCallback.cs :
	  exclude [Serializable] in NET_2_0.
	* XmlSerializerNamespaces.cs : removed beta-only AddInternal().
	* XmlSerializerVersionAttribute.cs : removed [Obsolete].
	* XmlMappingAccess.cs : it is [Flags].
	* SchemaImporter.cs : implement Extensions.
	* XmlAnyElementAttribute.cs,
	  XmlArrayAttribute.cs : added Order.
	  Note that it is not considered in XmlSerializer yet.


svn path=/branches/atsushi/mcs/; revision=67228
2006-11-01 19:45:33 +00:00
Ankit Jain 420698f9cb * SerializationCodeGenerator.cs (GenerateContract): Handle
'generateAsInternal' config option.

svn path=/trunk/mcs/; revision=66987
2006-10-25 23:46:54 +00:00
Gert Driesen 5a4fcc6e61 * XmlSerializerTests.cs: Added a few tests. Fixed coding style.
* XmlSerializer.cs: Output namespace declarations in same order as MS.

svn path=/trunk/mcs/; revision=66530
2006-10-10 19:54:54 +00:00
Gert Driesen b5eb88c87f * DeserializeTest.cs: Added several tests.
* XmlSerializerTestClasses.cs: Added test classes for encoded SOAP.
* XmlSerializerTests.cs: Added new tests and fixed existing test.
* XmlReflectionImporterTests.cs: Added test for invalid default
values.
* SoapReflectionImporterTests.cs: Fixed numbering of tests.
* XmlSerializer.cs: Corrected exception message when deserialization
fails.
* SerializationCodeGenerator.cs: Added support for flag enums.
* XmlReflectionImporter.cs: Use InvalidOperationException wrapper for
all exceptions that occur while reflecting member. Validate default
values to match MS.
* SoapReflectionImporter.cs: Revert small part of previous patch as
XmlSerializer expects enum value.

svn path=/trunk/mcs/; revision=66524
2006-10-10 17:53:49 +00:00
Gert Driesen 337a3e41c9 * SoapReflectionImporterTests.cs: Added tests for bug #78206.
* SoapReflectionImporter.cs: To match MS.NET, let exceptions that are
thrown during creation of map member bubble up. Only allow
SoapAttribute on primitive types and enums. Obtain default value for
attribute members.

svn path=/trunk/mcs/; revision=66139
2006-10-01 07:42:11 +00:00
Vladimir Krasnov 213bc960d4 * XmlTypeAttribute.cs: added property AnonymousType for 2.0
svn path=/trunk/mcs/; revision=65699
2006-09-20 07:47:03 +00:00
Lluis Sanchez 970ce239a2 2006-09-12 Lluis Sanchez Gual <[email protected]>
* System.Xml.Serialization/XmlSchemaImporter.cs: Added null check.


svn path=/trunk/mcs/; revision=65297
2006-09-12 12:01:03 +00:00
Andrew Skiba 9d6b8f8be9 ifdef TARGET_JVM
svn path=/trunk/mcs/; revision=65234
2006-09-11 15:07:26 +00:00
Lluis Sanchez dfc80e20d5 2006-09-05 Lluis Sanchez Gual <[email protected]>
* XmlSchemaImporter.cs: In MS.NET 2.0, simple type arrays are mapped
	to strings. Make sure maps returned by ImportClassSimpleType are always
	simple type maps. All this fixes bug #77585.


svn path=/trunk/mcs/; revision=65021
2006-09-06 17:52:53 +00:00
Lluis Sanchez d502f1f791 svn path=/trunk/mcs/; revision=64926 2006-09-05 11:42:28 +00:00
Kornél Pál 133ce64e0f Use assembly name and file version constants.
svn path=/trunk/mcs/; revision=64391
2006-08-25 20:32:53 +00:00
Konstantin Triger fb22f7e715 enable compilation using ms csc compiler
svn path=/trunk/mcs/; revision=63412
2006-08-06 14:14:12 +00:00
Atsushi Eno b3cbbff9ce 2006-07-24 Atsushi Enomoto <[email protected]>
In class/System.XML:
	* System.Xml.dll.sources : added XmlMappingAccess.

	* XmlMappingAccess.cs : new type in 2.0 RTM.
	* XmlCodeExporter.cs, SoapCodeExporter.cs,
	  MapCodeGenerator.cs,
	  XmlSchemaImporter.cs, SoapSchemaImporter.cs, SchemaImporter.cs,
	  SchemaImporterExtension.cs, SchemaImporterExtensionCollection.cs,
	  XmlMemberMapping.cs, XmlSerializationReader.cs :
	  several 2.0 API fixes from betas to RTM.

	In class/System.Web.Services:
	* ProtocolImporter.cs, ServiceDescriptionImporter.cs :
	  some 2.0 API fixes from betas to RTM.

	In tools/wsdl:
	* MonoWSDL2.cs : 2.0 API fixes from beta2 to RTM.


svn path=/trunk/mcs/; revision=62910
2006-07-24 10:50:58 +00:00
Lluis Sanchez cc62d11431 2006-06-07 Lluis Sanchez Gual <[email protected]>
* XmlTypeMapMember.cs: Added GlobalIndex property.
	* XmlTypeMapping.cs: When adding a member, initialize its GlobalIndex
	  property.
	* SerializationCodeGenerator.cs:
	* XmlSerializationWriterInterpreter.cs:
	* XmlSerializationReaderInterpreter.cs: Use GlobalIndex instead of
	  Index to get/set the values from the input array, since some Index
	  values are shared between attribute and element members. Fixes
	  bug #78562.


svn path=/trunk/mcs/; revision=61531
2006-06-07 14:33:48 +00:00
Atsushi Eno 61ab44349c 2006-05-30 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs,
	  XmlSerializerReaderInterpreter.cs : handle CDATA section as text
	  node. Fixed bug #78536.

	* XmlSerializerTests.cs : added tailored version of bug #78536 test.


svn path=/trunk/mcs/; revision=61294
2006-05-31 01:38:24 +00:00
Gert Driesen 0913889260 * XmlCodeExporterTests.cs: Added tests for arrays. Fixed usage of
XmlRootAttribute in tests.
* XmlCodeExporter.cs: Added bool argument to GenerateClass and
GenerateEnum methods that specifies whether we're dealing with a type
for a top-level element. In GenerateClass, do not always add Namespace
argument for XmlRootAttribute if isTopLevel is false, and do not
emit XmlRootAttribute if isTopLevel is false and no arguments have been
added.
* SoapCodeExporter.cs: Added bool argument to GenerateClass and
GenerateEnum methods.
* MapCodeGenerator.cs: Added bool argument to GenerateClass and
GenerateEnum methods.

svn path=/trunk/mcs/; revision=60710
2006-05-15 15:53:35 +00:00
Lluis Sanchez 0c92696ca1 2006-05-03 Lluis Sanchez Gual <[email protected]>
* SerializationCodeGenerator.cs: Allow generating serializer for
	  reading an XmlElement or XmlDocument as root element.
	  Properly generate jagged array creation.


svn path=/trunk/mcs/; revision=60207
2006-05-03 09:24:04 +00:00
Atsushi Eno 5de22fa983 2006-04-28 Atsushi Enomoto <[email protected]>
* XmlSerializationWriter.cs : fix cosmetic typo (bug #78228).


svn path=/trunk/mcs/; revision=60028
2006-04-28 06:58:11 +00:00