我有一個像XML:如何在XML中搜索給定的字符串?
<bodyText>
<1 beginIndex="0" endIndex="723">
The teddy bear is a soft toy in the form of a bear. Teddy bears are among the most popular gifts for children and are often given to adults to signify love, congratulations or sympathy.</1>
<2 beginIndex="724" endIndex="347">
Morris Michtom saw the drawing of Roosevelt and was inspired to create a new toy. He created a little stuffed bear cub and put it in his shop window with a sign that read "Teddy's bear," after sending a bear to Roosevelt and receiving permission to use his name.
</2>
</bodyText>
我如何在XML搜索特定的字符串? 例如:如果用戶輸入「羅斯福圖紙」。第二個xml元素包含這個字符串,它應該返回2(它應該返回段落號)。 如何找出?
無效的XML(節點名稱不能是數字) –