Skip to content

Commit

Permalink
Fix wrong namespace when using ref-Atribute on Element.
Browse files Browse the repository at this point in the history
Hopfully without evil side effects
  • Loading branch information
LokiMidgard committed May 22, 2017
1 parent 6fa150e commit 1ede289
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions XmlSchemaClassGenerator/TypeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -924,13 +924,13 @@ private IEnumerable<CodeAttributeDeclaration> 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)
{
Expand Down

0 comments on commit 1ede289

Please sign in to comment.