473,320 Members | 1,600 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,320 software developers and data experts.

Serializing heterogeneous lists to/from XML?

I'm working on a simple command-line app. The app takes an XML file
that provides the operations to perform. However, the problem I'm
running in to is that the file must contain a seperate array for each
class of operations it supports, even though all operations implement
the same execution interface (IModule implements Execute and
PostProcess), but have wildly different configuration members.

Because each module is very different to configure, but the same at
execution, the usual approach of copying the members from a stubbed-out
base class is inappropriate. Is there any way to unify their
serialized lists into a single list? Or do the XML lists have to be
homogeneous?

And as an aside, is there a text-based serialization system that is
less verbose than XML? Like a YAML serializer or something?

Thanks in advance,

-- Martin

Aug 3 '06 #1
1 1897
Hello ma***********@gmail.com,

If the issue is combining/uncombining then maybe you could use an XSLT template
to combine going out and break apart coming back in. This could be achieved
by using some custom code. Another thing that might work is using customer
serialization. This link is to Custom Serialization in the SDK http://msdn2.microsoft.com/en-us/library/ty01x675.aspx.

Adam Calderon [C# MVP]
http://blogs.interknowlogy.com/adamcalderon
I'm working on a simple command-line app. The app takes an XML file
that provides the operations to perform. However, the problem I'm
running in to is that the file must contain a seperate array for each
class of operations it supports, even though all operations implement
the same execution interface (IModule implements Execute and
PostProcess), but have wildly different configuration members.

Because each module is very different to configure, but the same at
execution, the usual approach of copying the members from a
stubbed-out base class is inappropriate. Is there any way to unify
their serialized lists into a single list? Or do the XML lists have
to be homogeneous?

And as an aside, is there a text-based serialization system that is
less verbose than XML? Like a YAML serializer or something?

Thanks in advance,

Aug 3 '06 #2

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

Similar topics

1
by: kj | last post by:
The main rationale I have seen for namespace support in XML is to enable the peaceful coexistence of XML fragments from various sources within the same ("heterogeneous") XML document without their...
8
by: Markus Dehmann | last post by:
I defined a base class in order to put heterogeneous values into a standard container: All values that I store in the container are derived from my base class. Now when I iterate over the...
1
by: Ivo Bronsveld | last post by:
All, I have quite a challenging task ahead of me. I need to write an object model (for code access) based on a schema, which cannot be made into a dataset because of it's complexity. So I...
10
by: copx | last post by:
I want to save a struct to disk.... as plain text. At the moment I do it with a function that just writes the data using fprintf. I mean like this: fprintf(fp, "%d %d", my_struct.a, my_struct.b)...
5
by: Alfonso Morra | last post by:
Hi, I am writing a messaging library which will allow me to send a generic message structure with custom "payloads". In many cases, a message must store a non-linear data structure (i.e....
2
by: Tobias Zimmergren | last post by:
Hi, just wondering what serializing really is, and howto use it? Thanks. Tobias __________________________________________________________________ Tobias ICQ#: 55986339 Current ICQ status: +...
13
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data...
2
by: Arash Partow | last post by:
Hi all, I've got a question related to emulating aspects of polymorphism with CRTP. Below is a typical polymorphic class hierarchy with a definition of a "somewhat" heterogeneous container of...
5
by: Gordon Airporte | last post by:
This is one of those nice, permissive Python features but I was wondering how often people actually use lists holding several different types of objects. It looks like whenever I need to group...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.