473,508 Members | 2,119 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

conditional xml serialization

4 New Member
Running into trouble conditioning what gets serialized by the XmlSerializer.

Case is as follows:

When a serialized element C is serialized under (as a child of) a specific other element P then I want the serializer to only serialize specific elements of C.

I know of ...Specified but found no way of achieving the above using it. Is there another way?

Any help would be greatly appreciated,

Regards
Nov 28 '09 #1
3 2544
Carel
4 New Member
... seems I have to flatten and introduce id's for structuring so I can use XmlExclude, still it would be nice to have say a callback from the serializer that gave me structural information like 'parent element' that I could use to enable/disable output of some element, is that possible?
Nov 29 '09 #2
Dormilich
8,658 Recognized Expert Moderator Expert
Hm, would be nice to know, what serializer (which language) you are talking about…
Nov 29 '09 #3
Carel
4 New Member
I am using C# and the XmlSerializer that comes with .Net. The introduction of identifiers replacing references solces the problem of the serializer serializing the instance more than once.
Nov 30 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

28
3414
by: Benjamin Niemann | last post by:
Hello, I've been just investigating IE conditional comments - hiding things from non-IE/Win browsers is easy, but I wanted to know, if it's possible to hide code from IE/Win browsers. I found...
3
782
by: Hollywood | last post by:
I have an class (A) that contains an class (B1) of type (B). An class (C), contained by class (A), contains its own class (B2) of type (B). When I want to serialize class (A), I want to ignore,...
0
1621
by: Philipp Sumi | last post by:
Hello newsgroup I'm using XML serialization controlled over attributes to serialize a couple of simple hierarchical objects into XML. My problem is, that I have a couple of elements within the...
2
3881
by: Vinayak Kamat | last post by:
Hi, I've got two classes - Entity which will have an array of Child objects in it and Child class. class Entity { public Child Children;
2
10381
by: Vinayak Kamat | last post by:
Hi, I've got two classes - Entity which will have an array of Child objects in it and Child class. class Entity { public Child Children;
4
1915
by: a | last post by:
I'm having trouble testing a custom object. I've tried many different approaches. One is shown below. The XML below shows the state of the object and I'm trying to test for that state, ie there...
0
1143
by: Kevin Burton | last post by:
I have defined the following property within a class: <XmlElement(ElementName:="qtyonhand")_ Public Property Quantity() As Integer Get Return _quantity End Get Set(ByVal value As Integer)...
0
2132
by: enricolyb | last post by:
hi, i created a xsd schema and corresponding cs file using xsd.exe. now i want to skip individual items inside an array of elements based on an attribute value. e.g. <nodes> <node attr = "1">...
1
11044
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
2
5533
by: mkvenkit.vc | last post by:
Hello, I hope this is the right place to post a question on Boost. If not, please let me know where I can post this message and I will do so. I am having a strange problem with std::string as...
0
7225
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,...
0
7124
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...
0
7385
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
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...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5629
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,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
418
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...

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.