From 1ede289cd45abc544b5ca9a026e8c8c3cd1a52e7 Mon Sep 17 00:00:00 2001 From: Patrick Kranz Date: Sat, 20 May 2017 18:33:17 +0200 Subject: [PATCH] Fix wrong namespace when using ref-Atribute on Element. Hopfully without evil side effects --- XmlSchemaClassGenerator/TypeModel.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/XmlSchemaClassGenerator/TypeModel.cs b/XmlSchemaClassGenerator/TypeModel.cs index 7f45f5e4..ffada90d 100644 --- a/XmlSchemaClassGenerator/TypeModel.cs +++ b/XmlSchemaClassGenerator/TypeModel.cs @@ -924,13 +924,13 @@ private IEnumerable GetAttributes(bool isArray) foreach (var attribute in attributes) { - if (Form == XmlSchemaForm.Qualified) + if (XmlNamespace != null) { - attribute.Arguments.Add(new CodeAttributeArgument("Namespace", new CodePrimitiveExpression(OwningType.XmlSchemaName.Namespace))); + attribute.Arguments.Add(new CodeAttributeArgument("Namespace", new CodePrimitiveExpression(XmlNamespace))); } - else if (XmlNamespace != null) + else if (Form == XmlSchemaForm.Qualified) { - attribute.Arguments.Add(new CodeAttributeArgument("Namespace", new CodePrimitiveExpression(XmlNamespace))); + attribute.Arguments.Add(new CodeAttributeArgument("Namespace", new CodePrimitiveExpression(OwningType.XmlSchemaName.Namespace))); } else if (!IsAny) {