Solved

deserialize ignoring complte tag in xml

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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 …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

770 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