473,378 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

XML Deserializer and Default Namespaces handling

Hello,
Recently I had to use the XmlSerializer object to deserialize one of the
objects in a project.
When I invoked Deserialize on the xml document containing the object
definition, I would get an exception from the XmlSerializer indicating the
root element was not expected.
This error was only resolved when the default namespace for the incoming xml
document was included in the constructor of the Deserializer.
However, the xml document did define a default namespace as is shown below:
<?xml version="1.0" encoding="IBM437"?>
<SubmitRsp
xmlns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/
REL-5-MM7-1-2">
<MM7Version>5.3.0</MM7Version>
<Status>
<StatusCode>1000</StatusCode>
<StatusText>Success</StatusText>
</Status>
<MessageID>20051118/10/C8******@192.168.0.121</MessageID>
</SubmitRsp>
So, why is it still necessary that I include a default namespace value in
the constructor of the XmlDeserializer (which is equal to the default
above).

Irwin
Nov 18 '05 #1
0 1317

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of...
1
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a...
9
by: Patty O'Dors | last post by:
Hi Can somebody please tell me what namespaces are actually for? I notice that when I start a new project in C#, it puts everything in a namespace of the same name as the project. I found them...
5
by: M Shafaat | last post by:
Hi, I want to develop a number of generic components which I intend to use in different applications. Is it a good idea to put all these generic components in one and the same namespace, e.g....
11
by: EAI | last post by:
Hi All, I have a XML of the following form <?xml version="1.0"?> <xxxx xmlns="http://xxx.xxx.com"> .... </xxxx> When I try to read xml using SelectSingleNode, I am getting exception
36
by: Wilfredo Sánchez Vega | last post by:
I'm having some issues around namespace handling with XML: >>> document = xml.dom.minidom.Document() >>> element = document.createElementNS("DAV:", "href") >>> document.appendChild(element)...
5
by: bugbear | last post by:
I need to do some fairly simple processing of XML files; I would like to be able to do this in perl. However, the XML I'm handling uses namespaces. In practice, the tags do not overlap, so I...
0
by: Sivajee Akula | last post by:
Hello All, I am trying to consume a .NET Service from Adobe LiveCycle Workflow. The service deals with complex objects. I am getting the following exception at the time of invocation of the...
9
by: Mark Olbert | last post by:
I'm trying to serialize (using XmlSerializer.Serialize) a class that I generated from an XSD schema using XSD.EXE /c. The problem I'm running into is that the root element needs to be unqualified,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.