Solved

deserialize ignoring complte tag in xml

Posted on 2011-03-03
3
365 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now