Kumar802
(Kumar802)
1
hi, I need to extract the NAME-SEARCH-12 of the corresponding POSTAL CODE SEARCH passed in input, which function can help me to do this?
for example, if I pass FRANK I would like to have 2045661 returned to me.
I tried with the where clause but failed.
this is the sample xml
XMLT.txt (575 Bytes)
ppr
(Peter Preuss)
2
Quick LINQ Prototype:
XNamespace Variable
Prototypes
xDoc.Descendants(xnsDefault2 + "SEARCH-12").Where(Function (x) x.Element(xnsDefault2 + "NAME-SEARCH-12").value.Equals("FRANK")).Select(Function (x) x.ELEMENT(xnsDefault2 + "POSTALCODE-SEARCH-12").value).toArray
Same within the Query syntax:
(From xe in xDoc.Descendants(xnsDefault2 + "SEARCH-12")
Where xe.Element(xnsDefault2 + "NAME-SEARCH-12").Value.Equals("FRANK")
Select v = xe.ELEMENT(xnsDefault2 + "POSTALCODE-SEARCH-12").Value).toArray
We also can decompose the LINQ to essential activities e.g. for each, assign…