C# XML deserialized. How to get a few elements from next line? -
if (slowo == "sprzedawca") { list<ocrres.word> temp = result.words.where(item => item.value.contains(slowo)).tolist(); int line = int.parse(temp.first().line); console.write(line); }
i need view next line elements line atribute of element. how them ? elements looks : <w line="9" blanks="0" fontindex="0" formating="0" confidence="79,56706" pointsize="0" r="90,351,172,30" id="21">sprzedawca</w>
correct me if i'm wrong. given xml , somewhere there there collection of w
elements. want collection , each element w
extract attributes, right? if case, below how can it:
var xml = xdocument.parse(input); var welements = xml.root.descendantsandself("w"); foreach (var w in welements) { // extract attribute values var confidence = w.attribute("confidence").value; console.writeline(confidence); // prints 79,56706 }
the code above gets elements w
, enumerates them. want check xml.root
null.
Comments
Post a Comment