Hi,
I need to extract the value of the Document_Body_content from below xhtml content. I used something similar to
String xpq="//div[div/div/div/h2/a[@name='Document_Body_content']]/self::div";
I tried like this but its not returning me the exact output....
My Sample xhtml :
-------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title></title>
</head>
<body>
<div class="article" lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title"><a id="ID" name="ID"></a></h2>
</div>
</div>
</div>
<div class="section" lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="Description_content"
name="Description_content"></a> <span
class="underline">Description</span></h2>
</div>
</div>
</div>
</div>
<div class="section" lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="Document_Body_content"
name="Document_Body_content"></a> <span class="underline">Document
Body</span></h2>
</div>
</div>
</div>
<p>To check the mount options on your NFS mounted filesystems, use
the <span class="italic">nfsstat -m</span> command. This will
display all the current settings.</p>
<p></p>
<p><span class="italic">Example:</span></p>
<p><span class="italic">% nfsstat -m</span></p>
<p><span class="italic">/home/<username> from
<NFS_Server>:/global/export/home1/<username> Flags:
vers=3,proto=tcp,sec=sys,hard,intr,link,symlink,ac l,rsize=32768,wsize=32768,retrans=5</span></p>
<p><span class="italic">/usr/dist from <NFS_Server>:/usr/dist
Flags:
vers=3,proto=tcp,sec=sys,soft,intr,link,symlink,ac l,rsize=32768,wsize=32768,retrans=5</span></p>
<p><span class="italic">/net/share/ from
<NFS_Server>:/share/export Flags:
vers=3,proto=tcp,sec=sys,hard,intr,link,symlink,ac l,rsize=32768,wsize=32768,retrans=5</span></p>
<p><span class="bold"><b>If any of the mount options are changed,
you must umount and remount the filesystem for the changes to take
effect. Only then will the changes be displayed with the <span
class="italic">nfsstat -m</span> command.</b></span></p>
<p>Note: the <username> and <NFS_Server> are
"placeholders" which represent the actual user and server names. Of
course, the server noted in each mount point could easily be
different (or not).</p>
<p></p>
</div>
<div class="section" lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a
id="_________Internal_Only_______content"
name="_________Internal_Only_______content"></a> <span
class="underline">Internal Only</span></h2>
</div>
</div>
</div>
<p>
[email protected]</p>
<p></p>
</div>
</div>
</body>
</html>
For Document_Body_content, I expect my output as below
<p>To check the mount options on your NFS mounted filesystems, use
the <span class="italic">nfsstat -m</span> command. This will
display all the current settings.</p>
<p></p>
<p><span class="italic">Example:</span></p>
<p><span class="italic">% nfsstat -m</span></p>
<p><span class="italic">/home/<username> from
<NFS_Server>:/global/export/home1/<username> Flags:
vers=3,proto=tcp,sec=sys,hard,intr,link,symlink,ac l,rsize=32768,wsize=32768,retrans=5</span></p>
<p><span class="italic">/usr/dist from <NFS_Server>:/usr/dist
Flags:
vers=3,proto=tcp,sec=sys,soft,intr,link,symlink,ac l,rsize=32768,wsize=32768,retrans=5</span></p>
<p><span class="italic">/net/share/ from
<NFS_Server>:/share/export Flags:
vers=3,proto=tcp,sec=sys,hard,intr,link,symlink,ac l,rsize=32768,wsize=32768,retrans=5</span></p>
<p><span class="bold"><b>If any of the mount options are changed,
you must umount and remount the filesystem for the changes to take
effect. Only then will the changes be displayed with the <span
class="italic">nfsstat -m</span> command.</b></span></p>
<p>Note: the <username> and <NFS_Server> are
"placeholders" which represent the actual user and server names. Of
course, the server noted in each mount point could easily be
different (or not).</p>
<p></p>
Please let me know how to incorporate xpath for this scenario.
Thanks
Suresh