|
Version
0.57ß - 13 Jul 2006
-
Currently still provides complete support for VS2005/.NET 2.0, and VS2003/.NET
1.1.
-
Collection class bug-fixes
The following bugs-fixes are implemented:
-
Names for schema complex types an elements with multiple occurrences can now
include the phrase 'Collection'.
-
Return types and parameters for the standard collection methods and properties
now use the correct collection element type.
-
The ToArray and FromArray
corrected for double-index ragged array return and parameter types,
respectively.
Note: CodeXS supports ragged array serialization with a maximum array rank of 2.
-
Override modifier on sub-classed virtual methods and properties
A more general solution has been provided to correct the error where a
virtual attribute is declared that should be an override
attribute.
-
Type instantiation support
Type instantiation (vs. primitive non-instantable types) checking is enhanced.
This should reduce the occurrence of the (usually recoverable) exception: "Cannot
determine type <type>''. Type assumed instantiable.".
-
Additional documentation support
Documentation utility methods have been added to allow for more extensive and
easier documentation of the generated code.
-
ISchemaObjectReader interface removed
This interface has been removed for the following reasons:
-
The ICodeModifer
interface provides the correct entry points for code modifer enhancements
requiring direct reading from the XML schemas.
-
The ICodeModifer interface now supports the .NET
2.0 SchemaImporterExtension class implementation
in the ICodeModifier
interface.
-
The ICodeModifer interface supports
initialization, which can be used as an entry point to pre-read schemas.
-
Logging support for ICodeModifier implementers
Logging using the CodeXS logging implementation can be used directly from an
ICodeModifier implementor in an external assembly.
-
Missing declarations and definitions in the code
A bug-fix was implemented to avoid this error, and appears to be working as
expected.
-
Assembly and file version control
Assembly and file version numbers now correspond with the public release version
numbers.
-
XML schema documentation add-in
An ICodeModifier implementation add-in has been provided which reads schema
<xs:documentation/>
tags and injects the documentation into
the generated code documentation comments.
This add-in is implemented by reading the XML schema(s) for the generated code
files, and matching schema-types to generated code types. This add-in is
implemented to read and modify the CodeDOM's after the other code-generators
have executed and therefore post-processes the CodeDOM. It has been implemented
to work for both .NET 2.0, and .NET 1.1.
For .NET 2.0, the CXSC application commandline is:
cxsc {..}
-m="CodeXS.Schema.StandardCodeModifier.dll","SchemaDocumentation.dll"
For .NET 1.1, the CXSC application
commadline is:
cxsc {..}
-m="CodeXS.Schema.StandardCodeModifier.Net1_1.dll","SchemaDocumentation.Net1_1.dll"
NOTE: The CodeXS online
tool does not utilize this add-in.
For .NET 2.0, the abstract class
System.Xml.Serialization.Advanced.SchemaImporterExtension has been
provided for sub-classing. A sub-classed instance receives call-backs via the
sub-class implemented ImportSchemaType methods,
and provides a context for the CodeDOM type/member and the System.Xml.Schema.XmlSchemaObject
that is used for the CodeDOM construct. This allows a code-modifier to modify
the CodeDOM while it is being constructed by the code generator. In general,
this provides a much safer and simpler way to relate the XML schema objects to
their CodeDOM counterparts.
CodeXS provides complete support for writing
SchemaImporterExtension implementers.
|
Version 0.56ß - 19 Jun 2006
-
Currently still provides complete support for VS2005/.NET 2.0, and VS2003/.NET
1.1.
-
Updated collection object generated code
Updated the collection object generated code:
My thanks to Dave Waterworth for this fix - Willem
Fourie
This version uses a different scheme when renaming class field members. This
resulted from various XML schemas using elements with the name 'id'
and 'Id', respectively. In prior versions this
resulted in the same field name '__Id'. In this
version they are distinct: '__id' and '__Id',
respectively.
-
Export code exception fix
During the import/export of the XmlTypeMapping
objects, the import/export sequence is now done via an explicit array list
object. This avoids the exception: 'collection changed
during iteration'.
In prior versions, this caused a code generation exception. However, often XML
schemas are defining elements with the same name as their type names. For
those cases, the single class generated is correct, as it represents completely
both the element and the type. For this reason, the prior exception has been
changed to provide a warning message in the CodeXS.log
file, and generation continues.
It is strongly recommended that these warning messages are noted, as they do
provide notification of potential de-/-serialization problems when the
generated code is used.
-
XmlChoiceIdentifierAttribute handling
This attribute was not handled correctly in prior versions, resulting in
de-/-serialization exceptions. This is now working and relies on the following
changes in this version:
-
The class properties intended for de-/-serialization now set/get the
original field types: In prior versions, if the property set/get type was an
ObjectCollection, it now sets/gets an object[]
array object, which is the original type generated in the CodeDOM. The
underlying field is still an ObjectCollection type,
and the collection ToArray and
FromArray methods are used to get/set (respectively) the field
correctly. Using the original scalar types for de-/-serialization avoids
the exception: 'ItemsElementName should be of type <type>[]'.
-
To support XML schemas that include an xs:any element
as part of the enumeration choice types, all XmlAnyElementAttribute
attributes for a member that also has an XmlChoiceIndentiferAttribute
attribute are removed.
-
To support XML schemas that include an xs:any element
as part of the enumeration choice types, all System.Xml.Serialization.XmlEnumAttribute("##any:")
attributes are removed from the choice identifier enumerated type members.
-
The attribute name is changed from 'ItemsElementName'
to '_ItemsElementName',
and the normal property generation correctly generates the _ItemsElementName
array set/get property, using the FromArray
and ToArray methods of the referenced collection
class.
Version 0.55ß - 14 Jan 2006
-
Generates code for VS2005/.NET 2.0, and VS2003/.NET 1.1
The code generated by the .NET 2.0 version of CodeXS WILL NOT build in
VS2003/.NET 1.1, primarily because the generated objects are implemented using
partial classes.
The code generated by the .NET 1.1 version of CodeXS WILL (almost always) build
and execute correctly in VS2005/.NET 2.0.
-
'Type xxx:yyy not found'
error during schema import operations
This error occurs as a result of the target schema not being compiled in all
cases. Mostly, this error did not occur running under .NET 1.1 but occurs
frequently in .NET 2.0. The error has been corrected for both versions of the
code-generator.
CodeXS now logs its progress and any errors/warnings to a log file in the code
generation output zip-file. The log file name is 'CodeXS.log'.
Please check this file for info if you are experiencing problems.
Version 0.54ß - 03 Mar 2005
-
Naming of XmlArrayAttribute serialization attributes
Fixed to ensure that any pre-existing XmlArrayAttribute attributes
are always named, to ensure correct tags when serializing.
-
Handling of elements containing arrays of arrays
This version correctly serializes arrays of arrays including
user-types, and unbounded xs:base64Binary and xs:hexBinary
types.
-
Ad-hoc serialization attribute errors
The following XSD code-generator errors have been corrected:
-
Removes the namespace qualifier in some XmlArrayItemAttribute's
that produces the error: 'The Form property may not be
'Unqualified' when an explicit Namespace property is present'.
-
For multi-dimensional arrays, fixes the XmlArrayItemAttribute
typeof argument to reflect the correct array-rank of the array item.
It is valid to specify an XML schema using an xs:element
and xs:<type>
with exactly the same name. The schema constructs may
also be related by setting the xs:element as a type of xs:<type>,
or they can be completely independent.
In both cases, the XSD generator generates a single class, where the one class
overwrites the existing class with the same name. As CodeXS takes
the output of the XSD generator as input, this cannot be directly fixed. The
current solution is to throw an InvalidOperationException with
the message:
Namespace already contains type
'<class-name>'
<class-name> can normally be referenced directly to the schema
xs:element and xs:<type>
by name.
Version 0.53ß - 22 Dec 2004
-
Serialization of typed collections as arrays
A problem was reported which occurs occasionally with the serialization of
typed-collections, where CodeXS renames the class atribute by adding a leading
underscore (as per Version 0.52ß Beta below). The serialization of the
collection correctly as an XmlArray does not occur and
serialization fails, or there is information loss. This is corrected by CodeXS
now adding the following attribute to the code:
[System.Xml.Serialization.XmlArrayAttribute("Rows")]
where the collection to be serialized has to be tag-named as "Rows", and it is a
typed-collection object.
-
Typed-collections for xs: types
Prior to this version, CodeXS generated typed-collections for only
complex-types or collections which were generated of type System.Object
(normally when XSD choice elements are specified). CodeXS now correctly
generates typed-collections for all xs: primitives such as
xs:string, xs:byte, etc.
-
schemaLocation, noNamespaceSchemaLocation attributes
for XmlRootAttribute'd classes
CodeXS generates these attributes automatically for all XmlRootAttribute'd
classes. However, in reality these do not always define root elements for XML
generation correctly. CodeXS now checks the entire XSD set, and if the XmlRootAttribute'd
class is referenced or instanced anywhere in the generated code, the schemaLocation/
noNamespaceSchemaLocation attribute code is not generated. In
practice, this results in code which works for most cases.
Version 0.52ß - 21 Nov 2004
-
Default construction of elements
Turning off default construction in Version 0.51ß was a hasty and unwise
decision. This option is now turned-on by default, and provides the following
additional changes:
-
The field-names now are changed to have two leading underscores, and the first
character of the name changed to lower-case. eg. the elment 'DefaultValue' will
generate a field-name '__defaultValue'.
-
A serialization-only property is provided which when called by the
XmlSerializer will NOT result in automatic instantiation of the oject.
The property has the same name as the original element name with an
added leading underscore. For the example above, the serialization
property name will be '_DefaultValue'. A suitable serialization attribute is
provided to ensure the correct serialization name ('DefaultValue') is used
during serialization.
-
A get/set accessor property is also provided which will provide automatic
instantiation if required, as before. The property is provided with an
XmlIgnore attribute so that it is excluded during serialization. As before,
this property name is the same as the orginal element. For the
example above, the accessor property name would be 'DefaultValue'.
My thanks to Abe Weinograd for suggesting this elegant solution
- Willem Fourie
-
Element/attribute form qualification
Form qualification now works correctly. In some instances, the previous
versions did not generate correct attribute forms for all element
attributes.
Version 0.51ß - 13 Nov 2004
-
Default construction of elements
Turned off now by default for the CodeXS online tool. A flag has been included
in the generator source code which can enable/disable this feature. This solves
the problem of null elements being constructed automatically during
serialization - thus rendering them effectively 'non-optional' when the
XML is generated.
Choice elements now work correctly. For a single choice item (maxOccurs="1"), if
default construction is turned on, a System.Object object
is not instantiated. For a mutiple choice items (maxOccurs="unbounded", an ObjectCollection
object is created (and
new'ed if default construction is turned on). the ObjectCollection
is a typed-collection for the type System.Object. The compiler
error
var = new object[]() obviously no longer occurs.
Version 0.50ß - 11 Sep 2004
|
|