Solved

deserialize ignoring complte tag in xml

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

15 Experts available now in Live!

Get 1:1 Help Now