Xpath expression
-
Hi, Im quite new to xpath in .Net. I have an XML-structure shown below that contain measurements(diameters,areas etc) The one below includes two different measurements of an Bi diameter and also the mean value. I now want to extract the mean value.(the 5.0 tag. As mentioned ,the file consists of many different measurements using the same strucutre. With the following expression I manage to extract the value but then I also get all the following mean values from all of the other calculations. How do I extract ONLY that node. I would really appriciate some help thanks! Expression: //item/item/concept[@codValue='11820-8']/following-sibling::item/value[@codValue='R-00317']/following::value MeasureGroup Bi Diameter 4.9 Bi Diameter 5.1 Bi Diameter Mean 5.0
-
Hi, Im quite new to xpath in .Net. I have an XML-structure shown below that contain measurements(diameters,areas etc) The one below includes two different measurements of an Bi diameter and also the mean value. I now want to extract the mean value.(the 5.0 tag. As mentioned ,the file consists of many different measurements using the same strucutre. With the following expression I manage to extract the value but then I also get all the following mean values from all of the other calculations. How do I extract ONLY that node. I would really appriciate some help thanks! Expression: //item/item/concept[@codValue='11820-8']/following-sibling::item/value[@codValue='R-00317']/following::value MeasureGroup Bi Diameter 4.9 Bi Diameter 5.1 Bi Diameter Mean 5.0
I hope this works:
/item/item[item/value[@codValue='R-00317']]/value
or/item/item[item/value='Mean']/value
"We make a living by what we get, we make a life by what we give." --Winston Churchill
-
I hope this works:
/item/item[item/value[@codValue='R-00317']]/value
or/item/item[item/value='Mean']/value
"We make a living by what we get, we make a life by what we give." --Winston Churchill
Hi, Thanks alot for your help I have been away a while but It I have tried your suggestion below and it extracts the mean value. /item/item[item/value[@codValue='R-00317']]/value I still have a small problem though. With your suggestion I also extract the other measurements mean value (see example below) I have tried to “tune” my search using your example, but I don’t get the hang of it, I need to somehow check two different attributes both and instead of just one as before. Is it possible to do that in one expression? Example code.. MeasureGroup Bi Diameter 4.9 Bi Diameter 5.1 Bi Diameter Mean 5.0 MeasureGroup ADH length 2.2 ADH length 2.4 ADH length Mean 2.3
-
I hope this works:
/item/item[item/value[@codValue='R-00317']]/value
or/item/item[item/value='Mean']/value
"We make a living by what we get, we make a life by what we give." --Winston Churchill
-
oopps. I forgot to ignore html..Example code.. MeasureGroup Bi Diameter 4.9 Bi Diameter 5.1 Bi Diameter Mean 5.0 MeasureGroup ADH length 2.2 ADH length 2.4 ADH length Mean 2.3
Which attribute did you want to add to the query?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
-
Which attribute did you want to add to the query?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
-
/item/item[concept[@codValue='11820-8'] and item/value[@codValue='R-00317']]/value The concept element, the third level item element(with the value child element) and second level value element (target of the query) are all siblings and children of the second level item element. George
"We make a living by what we get, we make a life by what we give." --Winston Churchill
-
/item/item[concept[@codValue='11820-8'] and item/value[@codValue='R-00317']]/value The concept element, the third level item element(with the value child element) and second level value element (target of the query) are all siblings and children of the second level item element. George
"We make a living by what we get, we make a life by what we give." --Winston Churchill