Click here to Skip to main content
15,885,757 members
Home / Discussions / C#
   

C#

 
AnswerRe: .NET Registry Creator Pin
Wendelius21-Jan-15 9:10
mentorWendelius21-Jan-15 9:10 
AnswerRe: .NET Registry Creator Pin
Mycroft Holmes21-Jan-15 20:47
professionalMycroft Holmes21-Jan-15 20:47 
AnswerRe: .NET Registry Creator Pin
Bernhard Hiller22-Jan-15 0:58
Bernhard Hiller22-Jan-15 0:58 
QuestionCoding help Pin
Member 1139217221-Jan-15 7:04
Member 1139217221-Jan-15 7:04 
AnswerRe: Coding help Pin
Wendelius21-Jan-15 7:19
mentorWendelius21-Jan-15 7:19 
GeneralRe: Coding help Pin
Member 1139217221-Jan-15 7:43
Member 1139217221-Jan-15 7:43 
GeneralRe: Coding help Pin
Pete O'Hanlon21-Jan-15 9:06
mvePete O'Hanlon21-Jan-15 9:06 
QuestionDeserialize Parts of an XML Pin
Antonio Cambule20-Jan-15 22:32
Antonio Cambule20-Jan-15 22:32 
Hello,

I'm working on an implementation of web-apis that return xml responses. I need to deserialize them into objects and objectlists.

I've already did it with one type of structure, but struggling on an other. When the needed xml data starts directly after the root tag then everything goes fine, but if there are some other tags in between or the structure gets more complex, then it doesn't deserialize and my list stays empty.

My question therefore is, how can i deserialize parts of xml that maybe come some tags later than the root and ignore the rest.

To give a better picture to what i want to achieve i have uploaded a small test application with testing xml files on my dropbox account for you to download: Link to test-application.

One of them works, the other one is the one that should also work.

Info: Testapp is written using: #Develop 5, C# 5 and .Net-Framework 4.5.2

Working XML:
XML
<response>
  <result first="Value 1" second="5" third="122"/>
  <result first="Value 2" second="9" third="13"/>
  <result first="Value 3" second="12" third="4"/>
</response>


Not working XML:
XML
<response>
  <method>something here</method>
  <answer>
    <result first="Value 1" second="5" third="122"/>
    <result first="Value 2" second="9" third="13"/>
    <result first="Value 3" second="12" third="4"/>
  </answer>
</response>


The problem is, that i do not need the information <answer> and or <method> the only data that really matters is in the <result> tag. I would like to ignore the rest.

Thanks and regards
Antonio
AnswerRe: Deserialize Parts of an XML Pin
Daniel Pfeffer20-Jan-15 22:55
professionalDaniel Pfeffer20-Jan-15 22:55 
GeneralRe: Deserialize Parts of an XML Pin
Antonio Cambule20-Jan-15 23:13
Antonio Cambule20-Jan-15 23:13 
GeneralRe: Deserialize Parts of an XML Pin
Daniel Pfeffer21-Jan-15 0:40
professionalDaniel Pfeffer21-Jan-15 0:40 
GeneralRe: Deserialize Parts of an XML Pin
Antonio Cambule21-Jan-15 0:56
Antonio Cambule21-Jan-15 0:56 
GeneralRe: Deserialize Parts of an XML Pin
Daniel Pfeffer21-Jan-15 2:51
professionalDaniel Pfeffer21-Jan-15 2:51 
AnswerRe: Deserialize Parts of an XML Pin
Gerry Schmitz21-Jan-15 13:00
mveGerry Schmitz21-Jan-15 13:00 
QuestionIE 11 Registry Entries Pin
namerg20-Jan-15 11:43
namerg20-Jan-15 11:43 
AnswerRe: IE 11 Registry Entries Pin
Pete O'Hanlon20-Jan-15 11:50
mvePete O'Hanlon20-Jan-15 11:50 
GeneralRe: IE 11 Registry Entries Pin
namerg20-Jan-15 11:57
namerg20-Jan-15 11:57 
GeneralRe: IE 11 Registry Entries Pin
Pete O'Hanlon20-Jan-15 12:14
mvePete O'Hanlon20-Jan-15 12:14 
GeneralRe: IE 11 Registry Entries Pin
namerg20-Jan-15 14:13
namerg20-Jan-15 14:13 
QuestionHex to UUEncode in C# Pin
NJdotnetdev20-Jan-15 2:04
NJdotnetdev20-Jan-15 2:04 
AnswerRe: Hex to UUEncode in C# Pin
OriginalGriff20-Jan-15 2:50
mveOriginalGriff20-Jan-15 2:50 
GeneralRe: Hex to UUEncode in C# Pin
NJdotnetdev20-Jan-15 3:24
NJdotnetdev20-Jan-15 3:24 
GeneralRe: Hex to UUEncode in C# Pin
OriginalGriff20-Jan-15 3:35
mveOriginalGriff20-Jan-15 3:35 
GeneralRe: Hex to UUEncode in C# Pin
NJdotnetdev20-Jan-15 3:43
NJdotnetdev20-Jan-15 3:43 
GeneralRe: Hex to UUEncode in C# Pin
OriginalGriff20-Jan-15 4:01
mveOriginalGriff20-Jan-15 4:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.