Given below is some HTML code corresponding to a div in a web page–
<div id="1">
Text #1
<p> Text #2 </p>
<img src="test.jpg" />
Text #3
<a href="http://google.com"> Text #4 </a>
<a href="http://www.bing.com"><img src="bing.jpg" /> </a>
Text #5
</div>
What will be the Xquery expression that retrieves the text
Text #1 Text #2 Text #3 Text #4 Text #5
from the expression above? The sequence in which links/images occur within the main div may differ, I just want to extract the text matter within that div…
Try
and change the path step (here: only root) as needed.
data()recursively returns all contents within a tag.