Commit Graph
76 Commits
Author SHA1 Message Date
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
Atsushi Eno d21b0aa3d9 Fixed bug #4141 - XmlSchemaImporter needs to consider attributeGroupRef in some case. 2013-08-09 17:22:38 +09:00
Marek Safar d5d4b9c22b Fix some warnings 2012-06-08 12:48:08 +01:00
Lluis Sanchez 4bf60c9c50 [System.Xml] Fix handling of XmlSchemaForm when importing elements
When the schema for is not explicitly set for an element, get the default form specified in the schema, and use 'unqualified' if there is no other default. This fixes bug #41.
2011-10-26 11:27:34 +02:00
Atsushi Eno 4fab2dc4c3 Fix bug #703910 - implement Order support in XmlSerializer. 2011-07-21 04:57:32 +09:00
Atsushi Eno 1550d9831a Check invalid recursion of xs:group use. Fixed bug #650117. 2011-05-18 01:09:21 +09:00
Atsushi Eno e1f4f82a0a Do not import xs:any member as XmlElement[]. Create a wrapper class instead.
Part of bugfix #670945.
2011-05-16 18:45:08 +09:00
Jb Evain 0253e041a7 Enable the System.Xml build for monodroid 2010-09-08 18:48:29 +02:00
Jb Evain 561bf6b6b2 bring a net_2_0 feature set to monotouch
svn path=/trunk/mcs/; revision=140606
2009-08-25 10:18:20 +00:00
Atsushi Eno c88cc51658 2009-01-22 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : hack ImportSchemaType().


svn path=/trunk/mcs/; revision=124164
2009-01-22 04:55:40 +00:00
Lluis Sanchez 3b8d404393 * XmlSchemaImporter.cs: Fix problem with primitive types with a forced
base class. It happens for example when a web service declares a
  soap header of type bool. The schema exporter needs to generate a
  subclass of SoapHeader for that header type. But if bool is used in
  the parameters, it must use System.Boolean, not the SoapHeader
  subclass. The solution is to store primitive types with a forced
  base class in a different table. In this way it is possible to have
  two maps for primitive types: one with the forced base class
  (returned by ImportDerivedTypeMapping) and one with the regular
  primitive map. Fixes bug #336739.

svn path=/trunk/mcs/; revision=99013
2008-03-26 11:33:13 +00:00
Atsushi Eno d9b24722e2 2007-11-01 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : simpleType is allowed to be imported.
	  (Part of #336739 fix.)

	* XmlSchemaImporterTests.cs : test for importing simple-typed
	  top-level element.


svn path=/trunk/mcs/; revision=88636
2007-11-01 11:38:14 +00:00
Atsushi Eno d903039b06 2007-10-30 Atsushi Enomoto <[email protected]>
* MapCodeGenerator.cs, XmlSchemaImporter.cs: revert the previous
	  change; the type is included in the output, but it should not be
	  the base type.

	* XmlCodeExporterTests.cs : disable the previous test; it's reverted.


svn path=/trunk/mcs/; revision=88364
2007-10-29 10:41:53 +00:00
Atsushi Eno 1d08a72b56 2007-10-30 Atsushi Enomoto <[email protected]>
* MapCodeGenerator.cs, XmlSchemaImporter.cs: when a complexType has
	  simple content extension/restriction and the simple base type is
	  schema-defined, it must be written in exported code. Fixed (part
	  of?) bug #336739.

	* XmlCodeExporterTests.cs : added test for (part of?) bug #336739,
	  base simple content enum type output.


svn path=/trunk/mcs/; revision=88363
2007-10-29 10:23:35 +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 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 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 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
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
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
Gert Driesen a392bb4584 * XmlCodeExporterTests.cs: Enabled tests for XmlCodeExporter.
* XmlSchemaImporterTests.cs: Fixed EnumSimpleContent test to pass
on MS.NET 2.0.
* XmlCodeExporter.cs: On 2.0 profile, CodeGenerationOptions defaults to
GenerateProperties. Use full type name for XML serialization attributes
instead of shortcut (without Attribute suffix). Always add Namespace
argument for XmlRootAttribute on classes. Added IsNullable argument for
XmlRootRootAttribute on classes. For attribute members, only output
Form argument for XmlSchemaForm.Qualified. Use MapCodeGenerator base
ctor that takes CodeGenerationOptions.
* SoapCodeExporter.cs: Use MapCodeGenerator base ctor that takes
CodeGenerationOptions.
* MapCodeGenerator.cs: Added CodeGenerationOptions to ctor. On 2.0
profile, emit GeneratedCodeAttribute, SerializableAttribute,
DebuggerStepThroughAttribute and DesignerCategoryAttribute for classes.
To match MS.NET, emit attribute members before element members.
* XmlReflectionImporter.cs: Enums are never nullable.
* XmlSchemaImporter.cs: Set IsNullable on map using value of
XmlSchemaElement.IsNillable. Added LocateElement overload that takes
XmlSchemaElement.

svn path=/trunk/mcs/; revision=59768
2006-04-21 17:54:54 +00:00
Gert Driesen 425d73b4db * XmlSchemaImporterTests.cs: Enabled tests for bug #77907.
* XmlSchemaImporter.cs: Make sure we pass TypeData for primitive types
to XmlReflectionImporter and SoapReflectionImporter to keep from
always ending up with the XSD type that directly maps to the CLR type.
* XmlReflectionImporter.cs: Added overloads taking TypeData instead of
Type. This improves performance by avoiding the use of
TypeTranslator.GetTypeData for types imported from a schema and fixes
bug #77907.
* SoapReflectionImporter.cs: Same.

svn path=/trunk/mcs/; revision=59508
2006-04-15 13:14:38 +00:00
Gert Driesen 9c4805562a * DeserializeTests.cs: Enabled tests for bug #77530.
* XmlSerializerTests.cs: Enabled tests for bug #77530.
* XmlTypeMapping.cs: EnumMapMember now also stores value for enums.
Modified EnumMapping.GetXmlName to use XmlCustomFormatter to support
serialization of integral value to enum constant name, and made sure
the exceptions we throw match those of MSFT. In EnumMapping.GetEnumName
throw InvalidOperationException if no matching enum constant exists.
In EnumMap ctor, initialize arrays holding XML names, enum names and
enum values.
* XmlSerializationReaderInterpreter.cs: Pass full type name to
EnumMapping.GetEnumName for construction of exception message.
* XmlSerializer.cs: In Deserialize, wrap InvalidOperationException
and InvalidCastException in another InvalidOperationException to match
MSFT. In Serialize, wrap InvalidOperationException, InvalidCastException
and the inner exception for a TargetInvocationException in an
InvalidOperationException to match MSFT.
* SerializationCodeGenerator.cs: In GenerateGetXmlEnumValue, use
XmlCustomFormatter.FromEnum in order to also support serialization
integral value to enum constant name. In 2.0 profile, throw
InvalidOperationException if numeric value cannot be serialized into
an enum constant value. In GenerateSingleEnumValue, no longer attempt
to parse unknown constant value but instead report it as
InvalidOperationException. Use string.Length instead of "" comparison
to check whether a string is empty. Fixed compiler warnings in
generated code (possible empty statement).
* XmlSerializationWriterInterpreter.cs: Pass full type name to
EnumMap.GetXmlName.
* XmlSchemaImporter.cs: Pass full type name to EnumMap.GetEnumName
to allow it to be used in exception messag* XmlReflectionImporter.cs.
Use FieldInfo instead of MemberInfo for enum fields. Use IsDefined 
instead of GetCustomAttributes for checking if a certain attribute
 is defined. Use integral value of enum constant in EnumMapMember ctor.
* SoapReflectionImporter.cs: Use FieldInfo instead of MemberInfo for
enum fields. Use IsDefined instead of GetCustomAttributes for checking
if a certain attribute is defined. Use integral value of enum constant
in EnumMapMember ctor.
es.

svn path=/trunk/mcs/; revision=57761
2006-03-10 04:37:54 +00:00
Lluis Sanchez 2bf5233dd8 2006-02-16 Lluis Sanchez Gual <[email protected]>
* XmlSchemaImporter.cs: Support importing complex types with
	  simple content based on enums. Fixes bug #76848.


svn path=/trunk/mcs/; revision=56948
2006-02-16 17:00:08 +00:00
Gert Driesen 0cb6273e10 * XmlSchemaImporter.cs: Fixed line endings (to CRLF).
svn path=/trunk/mcs/; revision=55210
2006-01-08 17:24:07 +00:00
Lluis Sanchez aa0acf396e 2005-11-07 Lluis Sanchez Gual <[email protected]>
* XmlSchemaImporter.cs: Added support for restrictions with
	embedded simple type definitions. 


svn path=/trunk/mcs/; revision=52648
2005-11-07 12:30:02 +00:00
Lluis Sanchez d8dc07c3f5 2005-06-07 Lluis Sanchez Gual <[email protected]>
* SerializationCodeGenerator.cs: When reading members by order,
	call a MoveToContext after each member read. In the fixup method
	don't cast returned values if it is reading an object array.
	
	* XmlSchemaImporter.cs: In ImportDerivedTypeMapping, if the type
	being imported is a primitive type, create a wrapper class that
	inherits from the provided one. This fixes bug #68809.
	
	* XmlSerializationReader.cs: Properly report unreferenced objects.
	Created an overload of ReadTypedPrimitive that reports elements of
	unknown type. Implemented Referenced(). 


svn path=/trunk/mcs/; revision=45586
2005-06-07 16:55:01 +00:00
Lluis Sanchez 61e5228375 2005-03-08 Lluis Sanchez Gual <[email protected]>
* XmlSchemaImporter.cs: Support importing schemas that define
	extra types in the standard xml schema namespace. When using encoded
	format, support the primitive types defined by the SOAP encoding
	namespace.


svn path=/trunk/mcs/; revision=41562
2005-03-08 11:58:25 +00:00
Lluis Sanchez 2e99fadc7f 2005-01-25 Lluis Sanchez Gual <[email protected]>
* XmlSchemaImporter.cs: When importing a default value of type enum,
	translate it from the schema value to the clr value.


svn path=/trunk/mcs/; revision=39515
2005-01-25 17:39:38 +00:00
Lluis Sanchez 4564ef55fd 2005-01-12 Lluis Sanchez Gual <[email protected]>
* XmlTypeMapElementInfo.cs: Added new IndexOfElement method.
	* XmlSchemaImporter.cs: When importing a base type of a complex type,
	make sure that the base class is always imported as a class and not
	as an array. If it has been imported as array, import it again.
	This fixes bug #70839. Other minor fixes as well.
	* XmlSerializationWriter.cs: Fixed warning.


svn path=/trunk/mcs/; revision=38750
2005-01-12 00:55:05 +00:00
Lluis Sanchez efb43a36d5 2004-11-30 Lluis Sanchez Gual <[email protected]>
* XmlCodeExporter.cs, XmlSerializer.cs, XmlSchemaImporter.cs: Fixed some
	compilation warnings.


svn path=/trunk/mcs/; revision=36831
2004-11-30 09:02:13 +00:00
Lluis Sanchez 3a465797dc * MapCodeGenerator.cs: When the Object type is exported, export all
derived maps. This was done in IncludeMetadata, but this method is
	  not called by the xsd tool.
	* XmlCodeExporter.cs: In AddMappingMetadata, only generate the root
	  attribute for primitive types and arrays.
	* XmlSchemaImporter.cs: Only export all object-derived maps if the
	  Object type is explicitly referenced by an element.
	* XmlSerializationWriter.cs: Minor fix.

svn path=/trunk/mcs/; revision=34573
2004-09-30 20:56:52 +00:00
Lluis Sanchez 2929822a90 * MapCodeGenerator.cs: Moved generation of XmlInclude attributes from
ExportDerivedTypes to the new ExportDerivedTypeAttributes method.
	* XmlReflectionImporter.cs: In ImportClassMapping, moved the call to
	  ImportIncludedTypes to the end, to make sure that the current map has all
	  needed data before derived maps are constructed.
	* XmlSchemaExporter.cs: Generate the base class of simple types that are
	  not primitive types. Set the correct value for IsMixed in extended types.
	* XmlSchemaImporter.cs: In ImportSimpleContent, take into account that
	  the base class of a simple type doesn't need to be a xsd type.
	  All those patches fix bug #65654

svn path=/trunk/mcs/; revision=33935
2004-09-15 14:16:41 +00:00
Lluis Sanchez 68a1f5925a * SerializationCodeGenerator.cs: Generate correct "HasValue" check for
value list serialization.
	* XmlSchemaImporter.cs: Added some null checks.

svn path=/trunk/mcs/; revision=33163
2004-09-01 16:16:24 +00:00
Lluis Sanchez 30fe4d3cb5 * CodeGenerationOptions.cs: Made the class internal for the 1.1 profile.
* ImportContext.cs: Implemented.
	* MapCodeGenerator.cs, SoapCodeExporter.cs, XmlCodeExporter.cs: Added new
	  options for 2.0. Implemented support for generating properties instead of
	  fields.
	* XmlSchemaImporter.cs: Added support for sharing types.

svn path=/trunk/mcs/; revision=31410
2004-07-23 15:21:14 +00:00
Lluis Sanchez 5221e53fda * CodeExporter.cs: Added private constructor.
* CodeGenerationOptions.cs: Set the correct enum values.
	* CodeIdentifier.cs: Added private constructor.
	* SchemaImporter.cs: Added internal constructor.
	* XmlMapping.cs, XmlSerializer.cs: 2.0 api fix.
	* XmlMemberMapping.cs, XmlSchemaImporter.cs, XmlSerializationWriter.cs: Added 2.0 stubs.
	* XmlSchemaProviderAttribute.cs, XmlSerializerAssemblyAttribute.cs,
	  XmlSerializerVersionAttribute.cs: Set correct attribute usage.
	* XmlSerializationReader.cs: Added missing setter for DecodeName.

svn path=/trunk/mcs/; revision=30970
2004-07-09 23:19:41 +00:00
Lluis Sanchez c397230784 * CodeIdentifier.cs: Removed constructor for NET_2_0.
* SoapCodeExporter.cs, SoapSchemaImporter.cs, XmlCodeExporter.cs,
	  XmlMapping.cs, XmlMemberMapping.cs, XmlReflectionImporter.cs,
	  XmlSchemaExporter.cs, XmlSchemaImporter.cs, XmlSchemas.cs,
	  XmlSerializationReader.cs, XmlSerializationWriter.cs, XmlSerializer.cs,
	  XmlSerializerNamespaces.cs: Added 2.0 stubs.
	* XmlMembersMapping.cs, XmlTypeMapping.cs: 2.0 fixage.
	* IXmlTextParser.cs, CodeExporter.cs, CodeGenerationOptions.cs,
	  ImportContext.cs, SchemaImporter.cs, SchemaImporterExtension.cs,
	  SchemaImporterExtensionCollection.cs, XmlDeserializationEvents.cs,
	  XmlSchemaProviderAttribute.cs, XmlSerializationGeneratedCode.cs,
	  XmlSerializerAssemblyAttribute.cs, XmlSerializerFactory.cs,
	  XmlSerializerVersionAttribute.cs: New files. More 2.0 stubs.

svn path=/trunk/mcs/; revision=30757
2004-07-05 18:12:19 +00:00
Lluis Sanchez 360208e654 * ReflectionHelper.cs: Correctly detect private types.
* XmlCodeExporter.cs: Implemented missing method.
	* XmlSchemaImporter.cs: Allow import of root primitive types.

svn path=/trunk/mcs/; revision=30104
2004-06-22 09:51:50 +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
Lluis Sanchez aae87fab03 * MapCodeGenerator.cs, SoapCodeExporter.cs: Generate the same XmlInclude
attributes that MS.NET generates.
	* SerializationCodeGenerator.cs: Avoid duplicate generation of maps in the
	  same reader/writer.
	* XmlCodeExporter.cs: Added support for ignore flag in maps and members.
	* XmlReflectionImporter.cs: Changed GetReflectionMembers to match
	  MS.NET member ordering. Patch by David Taylor.
	* XmlSchemaImporter.cs: When generating a choice member, set the ignore
	  flag. The generated enum must also not be included in the schema.
	* XmlTypeMapMember.cs: Added ignore flag.
	* XmlTypeMapping.cs: The AttributeMembers property now returns the
	  attributes in the correct order.

svn path=/trunk/mcs/; revision=29172
2004-06-10 08:47:59 +00:00
Lluis Sanchez 285cd2dcc8 * XmlSerializationReader.cs: Support schamea instance namespaces other than
the 2001 one when reading the xsi type.
	* MapCodeGenerator.cs: Take into account that the root namespace and element
	  name may have changed from one export to another of the same type. In
	  this case the class attributes need to be regenerated.
	* SoapCodeExporter.cs, XmlCodeExporter.cs: Take the enum name from XmlType,
	  not ElementName. Idem for namespace.
	* XmlReflectionImporter.cs: Set nullable property of XmlTypeMapping.
	* XmlRootAttribute.cs: Default value for nullable is true.
	* XmlSchemaImporter.cs: The root name for a class may change in some
	  scenarios (for example, when the type is initially exported as part of
	  another type and later exported as a root type).
	* XmlSerializationReader.cs: In GetXsiType(), if the type attribute is not
	  found using the standard namespace, try getting the type using
	  the 2000/10 and 1999 namespaces.
	* XmlTypeMapping.cs: Added IsNullable property. Updated SetRoot method.

svn path=/trunk/mcs/; revision=28711
2004-06-02 18:16:39 +00:00
Lluis Sanchez fb9c1efbf0 * SerializationCodeGenerator.cs, XmlSerializationReaderInterpreter.cs:
When reading an object using the typeof(object) map, an emty xsi:type
	  means that it has to read the contents into an XmlNode[].
	* TypeData.cs: Return the correct full name for inner classes.
	* XmlSchemaImporter.cs: Improved detection of types that represent
	  "anyType", and must be mapped to XmlElement, XmlNode or Object.
	* XmlSerializationReader.cs: In GetXsiType(), find the type attribute using
	  the correct namespace.
	  In ReadTypedPrimitive(), read the element as XmlNode[] if the type is
	  not known.

svn path=/trunk/mcs/; revision=26761
2004-05-05 13:32:08 +00:00