JAXP XPath expression compare Documents

J

Jeff Higgins

Hi all
Newbie to XPath. Can someone help with
an XPath expression(s) that will accomplish
the following using JAXP in J2SE-1.5.
Thanks
Jeff Higgins

In a class I have two private org.w3c.dom
Document fields; Directories,and FileList,
that are populated as below;

In a method I would like populate two
org.w3c.dom NodeSets with element nodes
as below:

populate absentInDirectories with
FileList file elements whose
text() value cannot be found in all
Directories filepath elements text() value.

populate absentInFileList with
Directories filepath elements whose
text() value cannot be found in
all FileList file elements text() value.

<directories>
<directory>
<file>
<filename>bar1.txt</filename>
<filepath>c:\bar1.txt</filepath>
</file>
<directory>
<file>
<filename>bar2.txt</filename>
<filepath>c:\foo\bar1.txt</filepath>
</file>
</directory>
</directory>
</directories>

<filelist>
<file>c:\bar1.txt</file>
<file>c:\foo2\barfly.doc</file>
</filelist>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top