単純な XPath 式と C# を使用してノード コンテンツを取得する方法に関する記事をたくさん見つけました。たとえば、次のようになります。
XPath:
/bookstore/author/first-name
C#:
string xpathExpression = "/bookstore/author/first-name";
nodes = navigator.Select(xpathExpression);
要素内にあるコンテンツを取得する方法を知りたいのですが、同じ要素が別の要素と別の要素の中にあります。
以下のコードを見てください。
<Cell>
<CellContent>
<Para>
<ParaLine>
<String>ABCabcABC abcABC abc ABCABCABC.</string>
</ParaLine>
</Para>
</CellContent>
</Cell>
要素ABCabcABC abcABC abc ABCABCABC.
からコンテンツを抽出したいだけです。String
XPath 式と.Net C#を使用して問題を解決する方法を知っていますか?