A simple parsing question

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have receiving XML documents contain ID attributes that are suffixed with *_PRE and *_POST. I would like to find a LINQ to XML query that will return the full name of all ID attributes with a "_POST" suffix.

<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; Properties<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Property <span style="color:Red; ID<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; MMI_PRE<span style="color:Black; "<span style="color:Blue; >ABC<span style="color:Blue; </<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Property <span style="color:Red; ID<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; MMI_POST<span style="color:Black; "<span style="color:Blue; >NO<span style="color:Blue; </<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Property <span style="color:Red; ID<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ReportOnlyFlag_PRE<span style="color:Black; "<span style="color:Blue; >1<span style="color:Blue; </<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Property <span style="color:Red; ID<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ReportOnlyFlag_POST<span style="color:Black; "<span style="color:Blue; >0<span style="color:Blue; </<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Property <span style="color:Red; ID<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; SettlementStatus_PRE<span style="color:Black; "<span style="color:Blue; >SPI<span style="color:Blue; </<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Property <span style="color:Red; ID<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; SettlementStatus_POST<span style="color:Black; "<span style="color:Blue; >CSI<span style="color:Blue; </<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Property <span style="color:Red; ID<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Frst_Name_PRE<span style="color:Black; "<span style="color:Blue; >VALERIEs<span style="color:Blue; </<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Property <span style="color:Red; ID<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Frst_Name_POST<span style="color:Black; "<span style="color:Blue; >VALERIE<span style="color:Blue; </<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Properties<span style="color:Blue; >
[/code]

For example, the query in the above sample would return:

MMI_POST ReportOnlyFlag_POST SettlementStatus_POST Frst_Name_POST



View the full article
 
Back
Top