473,836 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deserialize an XML file with multiple namespaces...

Hopefully I can ask this question without regaling you kind people in
too many gory details. Here's what I'm trying to do:
- I have a local XML file with a .GPX extension which I downloaded from
www.geocaching.com.
- The file contains a bunch of elements called <WPT>
- Within the WPT elements are a number of other elements <time>, <sym>,
<groundspeak:na me>...
- The non-qualified elements come from a schema/namespace at
http://www.topografix.com/GPX/
- The qualified elements come from a schema/namespace at
http://www.groundspeak.com/cache
- I ran xsd.exe with the /c option to generate the classes into which I
want to read my elements using a call to XmlSerializer.D eSerialize.

The problem:
- I can read all of the elements which fall within the topografix
namespace.
- I can't read any of the elements which fall within the groundspeak
namespace.

The questions:
- Is there a way to specifiy a namespace for the .DeSerialize method,
similar to that used with SelectNodes?
- Is there a way to specify nested namespaces with xsd.exe? (in this
case groundspeak is nested within topgrafix)
- Am I using the right tool for this job? I'm pretty new to XML, so if
I'm using a sledgehammer, when I need pliers, don't be shy about
letting me know. :-)
Thanks in advance for any insight you have to share.
-D

Dec 30 '06 #1
0 2430

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

Similar topics

7
5832
by: Ian Tompsett | last post by:
H I was wondering if it possible for an object to serialize/deserialize itself from XML. I'd be guessing that it would need to use the XmlSerializer class, but that seems to want to create a brand new object when deserializing. In my case I have an existing object that I'd like to pass some XML to for the object to repopulate its member variables. Similarly I'd like it to be able to populate an XML string from the values of its member...
2
11711
by: Hollywood | last post by:
After doing a search through google's archives of this list, I didn't see what I was looking for so here goes... Is it possible to serialize/deserialize multiple objects from a single XML file? I was looking to use the XML serialization to be able to translate complex XML elements in a single XML file through XML serialization as opposed to using SAX and coding my own serializer. However, the XML Serialization API appears to only...
2
9547
by: Greg | last post by:
I'm writing a class in C# .... I have a collection calls Reports made up of Report objects. I'm trying to deserialize an XML file that looks like : <Reports> <Report> <Title>some title</Title> <Notes> some notes </Notes> </Report> <Report> blah blah blah </Report>
5
11675
by: Geoff | last post by:
Is it possible to pull a single node (element) out of a complex XML file, using SelectSingleNode(), and then deserialize that node to an object? Could someone please post, or point me to, a simple, but complete example?
2
2558
by: tshad | last post by:
If I create multiple .dll files with the same namespace, but different classes. Is this the same thing as creating one file with one Namespace and all the classes in that namespace? If so, is it better to create multiple files or just one big file? Also, what causes ASP to look at each .dll file in the Bin folder. Even when I make changes, they seem to get picked up. How does ASP know to load the new .dll or the same .dll again if...
2
11541
by: Thomas S | last post by:
Any suggestions on how to deserialize an object from one line of XML? I'm trying to deserialize multiple objects from one XML document, each object on one line of the file. The serialization is working, but when I try to read the line back into a MemoryStream, and then to deserialize from that, I get an error that the root node doesn't exist. Example XML lines: <?xml version="1.0"?><LogItem
0
2052
by: PSingh | last post by:
Hi, I know this is a frequently asked question but have tried several combinations and cant seem to figure this out. I am serializing my object as follows: XmlSerializer serializer = new XmlSerializer(data.GetType()); StringWriter writer = new StringWriter(); XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces(); namespaces.Add("", "");
1
2328
by: Julien Sobrier | last post by:
Hello, I'm trying to deserialize an RSS feed that can contains 2 namespaces. FOr example, it can contain a tag <imageand/or <itunes:images>. I couldn't figure out how to get both. This simplified extract of code does not work: public class RSSFeed {
9
3303
by: =?Utf-8?B?ai5hLiBoYXJyaW1hbg==?= | last post by:
Hi, I have a schema that has an optional element, fieldTag4000Field. If the element is omitted from the XML request, when it is deserialized, it will be null when I check it - which is fine. What happens when the element is supplied as <fieldTag4000Field/(empty), it does not equate to null. I want to be able handle this at the deserialization level rahter than in my edits later.
0
9820
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9670
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10844
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10591
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9374
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4016
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3115
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.