[Mono-dev] [PATCH] XmlSchemeExporter for typed DataTable

Arina Itkes arinai at mainsoft.com
Mon Feb 4 04:16:02 EST 2008


Thanks. I fixed it.

-----Original Message-----
From: Atsushi Eno [mailto:atsushi at ximian.com] 
Sent: Monday, February 04, 2008 9:32 AM
To: Arina Itkes
Cc: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-dev] [PATCH] XmlSchemeExporter for typed DataTable

You have already committed your wrongly-formatted patch. Anyways:


> Modified:
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs
> ===================================================================
> ---
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs
2008-02-03 08:59:57 UTC (rev 94666)
> +++
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs
2008-02-03 10:05:06 UTC (rev 94667)
> @@ -239,12 +239,20 @@
>  				schemas.Add (map.Schema);
>  				ImportNamespace (currentSchema,
targetNs);
>  	        }
> -	        else if (existingSchema != map.Schema)
> +			else if (existingSchema != map.Schema &&
!CanBeDuplicated (existingSchema, map.Schema))

wrong indentation.

>  	        {
>  				throw new InvalidOperationException("The
namespace '" + targetNs +"' defined by the class '" + map.TypeFullName +
"' is a duplicate.");
>  	        }
>  		}
>  
> +		private static bool CanBeDuplicated(XmlSchema
existingSchema, XmlSchema schema)
missing space before '('

> +		{
> +			if(XmlSchemas.IsDataSet(existingSchema) &&
XmlSchemas.IsDataSet(schema)
ditto

> +				&& existingSchema.Id == schema.Id)
> +				return true;
> +			return false;
> +		}
> +
>  		void ExportClassSchema (XmlTypeMapping map)
>  		{
>  			if (IsMapExported (map)) return;

Atsushi Eno


Arina Itkes wrote:
> Ok. I moved the test to System.Data.
> 
> Please explain your claim about coding style. I didn't understand.
> 
> Arina.
> 
> -----Original Message-----
> From: mono-devel-list-bounces at lists.ximian.com
> [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Atsushi
> Eno
> Sent: Tuesday, January 29, 2008 8:09 PM
> To: mono-devel-list at lists.ximian.com
> Subject: Re: [Mono-dev] [PATCH] XmlSchemeExporter for typed DataTable
> 
> Hello,
> 
> You cannot add reference to System.Data.dll when building
> System.Xml. Add your DataSet related test under System.Data.
> 
> The fix itself looks ok, except for coding style. I don't think
> it was your first contribution though ...?
> http://www.mono-project.com/Coding_Guidelines
> 
> Atsushi Eno
> 
> 
> Arina Itkes wrote:
>>
>> Hi
>>
>>  
>>
>> I added a new test for exporting of a typed DataTable and a typed 
>> DataSet by the same XmlSchemaExporter and a fix for the
> XmlSchemaExporter.
>>  
>>
>> Generated typed DataTable and typed DataSet have an identical schema
> and 
>> an identical TargetNamespace. This fix is a workaround for this
> specific 
>> case.
>>
>>  
>>
>> Please review.
>>
>> Thanks.
>>
>>  
>>
>>
>>
>
------------------------------------------------------------------------
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 




More information about the Mono-devel-list mailing list