Serialization across 'like' attribute names

M

MattL

This serialization error appears to be not correct...

When a class defined in a specific namespace,e.g., "urn:A" and two
attributes which have the same local name, e.g., "Id", with one one attribute
defined as Qualified and in the namespace "urn:A" and the other attribute is
defined as Unqualified cannot be serialized.

The problem (as it appears to me) is that an unqualifed attribute does not
inherit a default namespace (per Namespaces in XML) and this is the error
thrown by the serializer, i.e., that both "Id" attributes appear in the same
namespace.

Thoughts!

-MattL
 
M

MattL

To clarify myself:
The unqualified attribute SHOULD NOT inherit the default namespace and it
appears that the serializer "puts" it in the default namespace.

-MattL
 
D

Dilip Krishnan

Hello MattL,

That is the default behaviour. If you done specify the namespace it resolves
to the default namespace.. am I missing something?
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
 
D

Dan Rogers

Hi Matt,

Please send me the schema you wish to make classes for.

Thanks
Dan Rogers
Microsoft Corporation
--------------------
 
M

MattL

Example

if this example the namespaces should be
{urn:A}Root
{""}Id
{urn:A}Id



[XmlRoot(Namespace="urn:A")]
[XmlType(Namespace="urn:A")]
public class Root
{
public class Root()
{
_xmlns.Add("x","urn:A");
}

private string _id;
private string _otherId;
private XmlSerializerNamespaces _xmlns = new XmlSerializerNamespaces();

[XmlNamespaceDeclarations()]
public XmlSerializerNamespaces Xmlns
{
get{return _xmlns;}
set{_xmlns = value;}
}
[XmlAttribute(Form=XmlSchemaForm.Unqualified)]
public string Id
{
get{return _id;}
set{_id = value;}
}

[XmlAttribute("Id", Namespace="urn:A", Form=XmlSchemaForm.Qualified)]
public string OtherId
{
get{return _otherId;}
set{_otherId = value;}
}
}
 
D

Dan Rogers

Hi Matt,
I think you are saying (ignoring your implementation) that you want to get
the following XML:

<Root xmlns="urn:A">
<id>namespaced value</id>
<id xmlns="">non-namespaced value</id>
</Root>

Is this correct? From a schema perspective, this is nearly impossible to
describe, so best practice would seem to dicate not doing this. However,
since it is to a degree, just a matter of what you can serialize, I think
it's possible to make this happen.

If so, try this:

[XmlRoot("urn:A")]
public class Root
{
[XmlElement(ElementName="id", Namespace="urn:A", DataType="string")]
public string firstId;

[XmlElement(ElementName="id", Form=XmlSchemaForm.Unqualified,
DataType="string")]
public string secondId;

public Root()
{
firstId = "namespaced value";
secondId = "non-namespaced value";
}
}

Hope this helps,

Dan Rogers
Microsoft Corporation

--------------------
Thread-Topic: Serialization across 'like' attribute names
thread-index: AcTkVqqruD3zK+TeQkiNrEeE6lyK7Q==
X-WBNR-Posting-Host: 208.223.183.28
From: "=?Utf-8?B?TWF0dEw=?=" <[email protected]>
References: <[email protected]>
Subject: RE: Serialization across 'like' attribute names
Date: Fri, 17 Dec 2004 08:37:15 -0800
Lines: 112
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:27278
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

Example

if this example the namespaces should be
{urn:A}Root
{""}Id
{urn:A}Id



[XmlRoot(Namespace="urn:A")]
[XmlType(Namespace="urn:A")]
public class Root
{
public class Root()
{
_xmlns.Add("x","urn:A");
}

private string _id;
private string _otherId;
private XmlSerializerNamespaces _xmlns = new XmlSerializerNamespaces();

[XmlNamespaceDeclarations()]
public XmlSerializerNamespaces Xmlns
{
get{return _xmlns;}
set{_xmlns = value;}
}
[XmlAttribute(Form=XmlSchemaForm.Unqualified)]
public string Id
{
get{return _id;}
set{_id = value;}
}

[XmlAttribute("Id", Namespace="urn:A", Form=XmlSchemaForm.Qualified)]
public string OtherId
{
get{return _otherId;}
set{_otherId = value;}
}
}

Dan Rogers said:
Hi Matt,

Please send me the schema you wish to make classes for.

Thanks
Dan Rogers
Microsoft Corporation
-------------------- does
not the
same
 
M

MattL

Dan,

I apoligize, I should have been using [XmlAttribute] and not [XmlElement]

consider this XML

<x:root xmlns:x="urn:A">
<x:child Id="1" x:Id="2"/>
</x:root>

Now...two Ids exist. One is qualified as {""}Id and the other {urn:A}Id
The default namespace is xmlns="" not "urn:A". When you attempt to
serialize this you get a namespace collision in that the serializer believes
that {""}Id and {urn:A}Id belong to the same namespace, i.e., urn:A.

Sorry for the confusion.

-MattL






Dan Rogers said:
Hi Matt,
I think you are saying (ignoring your implementation) that you want to get
the following XML:

<Root xmlns="urn:A">
<id>namespaced value</id>
<id xmlns="">non-namespaced value</id>
</Root>

Is this correct? From a schema perspective, this is nearly impossible to
describe, so best practice would seem to dicate not doing this. However,
since it is to a degree, just a matter of what you can serialize, I think
it's possible to make this happen.

If so, try this:

[XmlRoot("urn:A")]
public class Root
{
[XmlElement(ElementName="id", Namespace="urn:A", DataType="string")]
public string firstId;

[XmlElement(ElementName="id", Form=XmlSchemaForm.Unqualified,
DataType="string")]
public string secondId;

public Root()
{
firstId = "namespaced value";
secondId = "non-namespaced value";
}
}

Hope this helps,

Dan Rogers
Microsoft Corporation

--------------------
Thread-Topic: Serialization across 'like' attribute names
thread-index: AcTkVqqruD3zK+TeQkiNrEeE6lyK7Q==
X-WBNR-Posting-Host: 208.223.183.28
From: "=?Utf-8?B?TWF0dEw=?=" <[email protected]>
References: <[email protected]>
Subject: RE: Serialization across 'like' attribute names
Date: Fri, 17 Dec 2004 08:37:15 -0800
Lines: 112
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:27278
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

Example

if this example the namespaces should be
{urn:A}Root
{""}Id
{urn:A}Id



[XmlRoot(Namespace="urn:A")]
[XmlType(Namespace="urn:A")]
public class Root
{
public class Root()
{
_xmlns.Add("x","urn:A");
}

private string _id;
private string _otherId;
private XmlSerializerNamespaces _xmlns = new XmlSerializerNamespaces();

[XmlNamespaceDeclarations()]
public XmlSerializerNamespaces Xmlns
{
get{return _xmlns;}
set{_xmlns = value;}
}
[XmlAttribute(Form=XmlSchemaForm.Unqualified)]
public string Id
{
get{return _id;}
set{_id = value;}
}

[XmlAttribute("Id", Namespace="urn:A", Form=XmlSchemaForm.Qualified)]
public string OtherId
{
get{return _otherId;}
set{_otherId = value;}
}
}

Dan Rogers said:
Hi Matt,

Please send me the schema you wish to make classes for.

Thanks
Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: Serialization across 'like' attribute names
thread-index: AcTddv9JsCx498jxRx2TdGUFw+iZkg==
X-WBNR-Posting-Host: 208.223.183.27
From: "=?Utf-8?B?TWF0dEw=?=" <[email protected]>
References: <[email protected]>
Subject: RE: Serialization across 'like' attribute names
Date: Wed, 8 Dec 2004 14:41:03 -0800
Lines: 26
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:27099
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

To clarify myself:
The unqualified attribute SHOULD NOT inherit the default namespace and it
appears that the serializer "puts" it in the default namespace.

-MattL

:

This serialization error appears to be not correct...

When a class defined in a specific namespace,e.g., "urn:A" and two
attributes which have the same local name, e.g., "Id", with one one
attribute
defined as Qualified and in the namespace "urn:A" and the other
attribute is
defined as Unqualified cannot be serialized.

The problem (as it appears to me) is that an unqualifed attribute does
not
inherit a default namespace (per Namespaces in XML) and this is the
error
thrown by the serializer, i.e., that both "Id" attributes appear in the
same
namespace.

Thoughts!

-MattL
 
D

Dan Rogers

Hi Matt,

Yes, you're going to have lots of serialization issues if you try to do
this. Since the nill namespace is not addressible, and because the rules
of XML say that unqualified child attributes default to the namespace of
their parent element, it's at least debatable as to whether this particular
construct can even be described using a schema.

As a "did you try this" - I'd be shocked if it worked - but did you try
treating the nill namespace value "" as a string, and making it a qualified
attribute?

Dan
--------------------
Thread-Topic: Serialization across 'like' attribute names
thread-index: AcTpyavCWD0KjUIjS4ith40Ppl1D9A==
X-WBNR-Posting-Host: 208.223.183.28
From: "=?Utf-8?B?TWF0dEw=?=" <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
Subject: RE: Serialization across 'like' attribute names
Date: Fri, 24 Dec 2004 07:03:05 -0800
Lines: 210
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:27381
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

Dan,

I apoligize, I should have been using [XmlAttribute] and not [XmlElement]

consider this XML

<x:root xmlns:x="urn:A">
<x:child Id="1" x:Id="2"/>
</x:root>

Now...two Ids exist. One is qualified as {""}Id and the other {urn:A}Id
The default namespace is xmlns="" not "urn:A". When you attempt to
serialize this you get a namespace collision in that the serializer believes
that {""}Id and {urn:A}Id belong to the same namespace, i.e., urn:A.

Sorry for the confusion.

-MattL






Dan Rogers said:
Hi Matt,
I think you are saying (ignoring your implementation) that you want to get
the following XML:

<Root xmlns="urn:A">
<id>namespaced value</id>
<id xmlns="">non-namespaced value</id>
</Root>

Is this correct? From a schema perspective, this is nearly impossible to
describe, so best practice would seem to dicate not doing this. However,
since it is to a degree, just a matter of what you can serialize, I think
it's possible to make this happen.

If so, try this:

[XmlRoot("urn:A")]
public class Root
{
[XmlElement(ElementName="id", Namespace="urn:A", DataType="string")]
public string firstId;

[XmlElement(ElementName="id", Form=XmlSchemaForm.Unqualified,
DataType="string")]
public string secondId;

public Root()
{
firstId = "namespaced value";
secondId = "non-namespaced value";
}
}

Hope this helps,

Dan Rogers
Microsoft Corporation

--------------------
Thread-Topic: Serialization across 'like' attribute names
thread-index: AcTkVqqruD3zK+TeQkiNrEeE6lyK7Q==
X-WBNR-Posting-Host: 208.223.183.28
From: "=?Utf-8?B?TWF0dEw=?=" <[email protected]>
References: <[email protected]>
Subject: RE: Serialization across 'like' attribute names
Date: Fri, 17 Dec 2004 08:37:15 -0800
Lines: 112
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:27278
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

Example

if this example the namespaces should be
{urn:A}Root
{""}Id
{urn:A}Id



[XmlRoot(Namespace="urn:A")]
[XmlType(Namespace="urn:A")]
public class Root
{
public class Root()
{
_xmlns.Add("x","urn:A");
}

private string _id;
private string _otherId;
private XmlSerializerNamespaces _xmlns = new XmlSerializerNamespaces();

[XmlNamespaceDeclarations()]
public XmlSerializerNamespaces Xmlns
{
get{return _xmlns;}
set{_xmlns = value;}
}
[XmlAttribute(Form=XmlSchemaForm.Unqualified)]
public string Id
{
get{return _id;}
set{_id = value;}
}

[XmlAttribute("Id", Namespace="urn:A", Form=XmlSchemaForm.Qualified)]
public string OtherId
{
get{return _otherId;}
set{_otherId = value;}
}
}

:

Hi Matt,

Please send me the schema you wish to make classes for.

Thanks
Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: Serialization across 'like' attribute names
thread-index: AcTddv9JsCx498jxRx2TdGUFw+iZkg==
X-WBNR-Posting-Host: 208.223.183.27
From: "=?Utf-8?B?TWF0dEw=?=" <[email protected]>
References: <[email protected]>
Subject: RE: Serialization across 'like' attribute names
Date: Wed, 8 Dec 2004 14:41:03 -0800
Lines: 26
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:27099
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

To clarify myself:
The unqualified attribute SHOULD NOT inherit the default namespace
and
it
appears that the serializer "puts" it in the default namespace.

-MattL

:

This serialization error appears to be not correct...

When a class defined in a specific namespace,e.g., "urn:A" and two
attributes which have the same local name, e.g., "Id", with one one
attribute
defined as Qualified and in the namespace "urn:A" and the other
attribute is
defined as Unqualified cannot be serialized.

The problem (as it appears to me) is that an unqualifed attribute does
not
inherit a default namespace (per Namespaces in XML) and this is the
error
thrown by the serializer, i.e., that both "Id" attributes appear
in
the
same
namespace.

Thoughts!

-MattL
 
M

MattL

Hi Dan,
[1] and [2] (I think) state that the unprefixed attribute *does not* inherit
the namespace of the parent element rather it inherits the default namespace
which is empty string. I believe that [2] also states that the {""}Id and
{"someUri"}Id are unique since they are uniquely qualified.

So, either I'm mistaken in my interpretation of this or the serializer
simply cannot perform this operation (which I think indicates a bug).

[1] http://www.w3.org/TR/REC-xml-names/#defaulting
[2] http://www.w3.org/TR/REC-xml-names/#uniqAttrs

Thoughts?

Thx,

-MattL


Dan Rogers said:
Hi Matt,

Yes, you're going to have lots of serialization issues if you try to do
this. Since the nill namespace is not addressible, and because the rules
of XML say that unqualified child attributes default to the namespace of
their parent element, it's at least debatable as to whether this particular
construct can even be described using a schema.

As a "did you try this" - I'd be shocked if it worked - but did you try
treating the nill namespace value "" as a string, and making it a qualified
attribute?

Dan
--------------------
Thread-Topic: Serialization across 'like' attribute names
thread-index: AcTpyavCWD0KjUIjS4ith40Ppl1D9A==
X-WBNR-Posting-Host: 208.223.183.28
From: "=?Utf-8?B?TWF0dEw=?=" <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
Subject: RE: Serialization across 'like' attribute names
Date: Fri, 24 Dec 2004 07:03:05 -0800
Lines: 210
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:27381
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

Dan,

I apoligize, I should have been using [XmlAttribute] and not [XmlElement]

consider this XML

<x:root xmlns:x="urn:A">
<x:child Id="1" x:Id="2"/>
</x:root>

Now...two Ids exist. One is qualified as {""}Id and the other {urn:A}Id
The default namespace is xmlns="" not "urn:A". When you attempt to
serialize this you get a namespace collision in that the serializer believes
that {""}Id and {urn:A}Id belong to the same namespace, i.e., urn:A.

Sorry for the confusion.

-MattL






Dan Rogers said:
Hi Matt,
I think you are saying (ignoring your implementation) that you want to get
the following XML:

<Root xmlns="urn:A">
<id>namespaced value</id>
<id xmlns="">non-namespaced value</id>
</Root>

Is this correct? From a schema perspective, this is nearly impossible to
describe, so best practice would seem to dicate not doing this. However,
since it is to a degree, just a matter of what you can serialize, I think
it's possible to make this happen.

If so, try this:

[XmlRoot("urn:A")]
public class Root
{
[XmlElement(ElementName="id", Namespace="urn:A", DataType="string")]
public string firstId;

[XmlElement(ElementName="id", Form=XmlSchemaForm.Unqualified,
DataType="string")]
public string secondId;

public Root()
{
firstId = "namespaced value";
secondId = "non-namespaced value";
}
}

Hope this helps,

Dan Rogers
Microsoft Corporation

--------------------
Thread-Topic: Serialization across 'like' attribute names
thread-index: AcTkVqqruD3zK+TeQkiNrEeE6lyK7Q==
X-WBNR-Posting-Host: 208.223.183.28
From: "=?Utf-8?B?TWF0dEw=?=" <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
Subject: RE: Serialization across 'like' attribute names
Date: Fri, 17 Dec 2004 08:37:15 -0800
Lines: 112
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:27278
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

Example

if this example the namespaces should be
{urn:A}Root
{""}Id
{urn:A}Id



[XmlRoot(Namespace="urn:A")]
[XmlType(Namespace="urn:A")]
public class Root
{
public class Root()
{
_xmlns.Add("x","urn:A");
}

private string _id;
private string _otherId;
private XmlSerializerNamespaces _xmlns = new XmlSerializerNamespaces();

[XmlNamespaceDeclarations()]
public XmlSerializerNamespaces Xmlns
{
get{return _xmlns;}
set{_xmlns = value;}
}
[XmlAttribute(Form=XmlSchemaForm.Unqualified)]
public string Id
{
get{return _id;}
set{_id = value;}
}

[XmlAttribute("Id", Namespace="urn:A", Form=XmlSchemaForm.Qualified)]
public string OtherId
{
get{return _otherId;}
set{_otherId = value;}
}
}

:

Hi Matt,

Please send me the schema you wish to make classes for.

Thanks
Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: Serialization across 'like' attribute names
thread-index: AcTddv9JsCx498jxRx2TdGUFw+iZkg==
X-WBNR-Posting-Host: 208.223.183.27
From: "=?Utf-8?B?TWF0dEw=?=" <[email protected]>
References: <[email protected]>
Subject: RE: Serialization across 'like' attribute names
Date: Wed, 8 Dec 2004 14:41:03 -0800
Lines: 26
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:27099
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

To clarify myself:
The unqualified attribute SHOULD NOT inherit the default namespace and
it
appears that the serializer "puts" it in the default namespace.

-MattL

:

This serialization error appears to be not correct...

When a class defined in a specific namespace,e.g., "urn:A" and two
attributes which have the same local name, e.g., "Id", with one one
attribute
defined as Qualified and in the namespace "urn:A" and the other
attribute is
defined as Unqualified cannot be serialized.

The problem (as it appears to me) is that an unqualifed attribute
does
not
inherit a default namespace (per Namespaces in XML) and this is the
error
thrown by the serializer, i.e., that both "Id" attributes appear in
the
same
namespace.

Thoughts!

-MattL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top