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.
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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
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
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
* 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
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
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
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