Click here to Skip to main content
15,905,563 members

Comments by kjohansen2000 (Top 9 by date)

kjohansen2000 30-Dec-21 6:40am View    
I got your reply on the original question:

"Sorry, i was busy. You have to use the same logic...
This: x.Parent.Attribute("Type").Value extracts "Type" atribute. To get "Number" attribute, use: x.Parent.Attribute("Number").Value
:)"

I don't know how to implement this, I actually tried it, but don't really understand the logic.. :(
kjohansen2000 30-Dec-21 5:15am View    
Thanks Maciej,

don't i have to change something in this, looking for "number" ?
Dim result = xdoc.Descendants("Property"). _
Where(Function(x) propTypes2find.Any(Function(a) x.Attribute("Type").Value=a) AndAlso _
deviceTypes2find.Any(Function(y) x.Parent.Attribute("Type").Value = y)). _
Select(Function(x) Tuple.Create(x.Parent.Attribute("Type").Value, x.Attribute("Type").Value, x.Value)). _
ToList()
kjohansen2000 20-Dec-21 18:07pm View    
Hi Maciej,

i still owe you that beer :)

One more question, if you are up to it?


<root>
<tree version="01.00" company="OTHER" stationnr="0111">
<device type="1">
<property type="1">111
<device type="2" number="1">
<property type="34">INT
<device type="3">
<device type="4" number="1">
<property type="56">192.168.242.192
<device type="29">
<property type="71">11016938


<device type="4" number="2">
<property type="56">192.168.242.193
<device type="29">
<property type="71">11016933








How do I extract the "Number" value in <device type="2" ...=""> ??

Kind regards
Kenneth
kjohansen2000 13-Aug-20 9:07am View    
Would it be possible to store it in data and calculate it by partition over etc.?
kjohansen2000 13-Aug-20 9:04am View    
I missed your comment, so sorry for the reply time.

Is the hard part possible? or am i in for another approach?