Edwin,

        Okay, here we go.  We've got a lot to talk about.  First off,
the way you're doing properties is probably screwing you up.  If this
is my properties file:

/AAA/BBB[@A='1']

Then the actual KEY you get back is /AAA/BBB[@A which is what I saw
when I put a print statement in your filter method.  The easiest way
around this if you still want to use a properties method is to make
the key something like value1 and make the expression the value:

value1=/AAA/BBB[@A='1']

This works because properties file only pays attention to the first
equal sign.


Next, once I got that working the attribute worked fine and so did the
element.  I have attached my example xml file, my properties file and
my modified version of your java app.  My modifications are marked with
comments.  You can find my comments by looking for JASON.

Hope this helps.


-Jason
<?xml version="1.0" encoding="UTF-8"?>

<AAA>
  <BBB A="2">
    <C>b</C>
  </BBB>
</AAA>

Attachment: DomFilter.java
Description: DomFilter.java

Attachment: DomFilter.class
Description: DomFilter.class

<AAA>
   <BBB A="1">
      <C>
         a
      </C>
   </BBB>
   <BBB A="2">
      <C>b</C>
   </BBB>
   <BBB A="3">
      <C>
         c
      </C>
   </BBB>
   <BBB A="4">
      <C>
         d
      </C>
   </BBB>
</AAA>

Attachment: in.properties
Description: in.properties

Reply via email to