Solved

deserialize ignoring complte tag in xml

Posted on 2011-03-03
3
367 Views
Last Modified: 2012-06-27
Can anyone please help me how to deserialize xml ignoring couple or xml elements.

Problem.

Some of the xml elements are encrypted. Before i can decrypt i have to deserialize rest of the xml.

any help.
0
Comment
Question by:NetSri
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 35029406
If you class doesn't have a property to represent a particular element, it should be ignored. If it does, however, and you still want to ignore that field, you can apply the XmlIgnore attribute to that particular property:

    http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattributes.xmlignore.aspx
public class Book
{
    public string Title { get; set; }
    public string ISBN { get; set; }

    [System.Xml.Serialization.XmlIgnore()]
    public int PageCount { get; set; }
}

Open in new window

0
 

Author Comment

by:NetSri
ID: 35325103
Thank you very much , solved it
0
 

Author Closing Comment

by:NetSri
ID: 36158009
Thank you
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question