.xml ファイルのみを含むフォルダーがあります。私のプログラムは、各ファイルを読み取り、タグ間に「false」があるファイルの名前を返す必要があります。私が考えていた:
        final Pattern pattern = Pattern.compile("<isTest>(.+?)</isTest>");
        final Matcher matcher = pattern.matcher("<isTest>false</isTest>");
        matcher.find();
        System.out.println(matcher.group(1));
私はJavaが初めてなので、どんな助けでも大歓迎です。
どこが間違っているのか教えてもらえますか?
public class FileIO 
{
    public static void main(String[] args) 
    {
        File dir = new File("d:\temp");
        List<String> list = new ArrayList<String>();
        //storing the names of the files in an array. 
        if (dir.isDirectory()) 
        {
          String[] fileList = dir.list();
          Pattern p = Pattern.compile("^(.*?)\\.xml$");
          for (String file : fileList) 
          {
            Matcher m = p.matcher(file);
            if (m.matches()) 
            {
              list.add(m.group(1));
            }
          }
        }
        try
        {
            XPathFactory xPathFactory = XPathFactory.newInstance( );
            XPath xpath = xPathFactory.newXPath(  );
            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(  );
            DocumentBuilder builder = docBuilderFactory.newDocumentBuilder(  );
            //Loop over files
            for (int i = 0; i < fileList.length; i++)
            {   
                Document doc =  builder.parse(fileList[i]);
                boolean matches = "false".equals(xpath.evaluate("//isTest/text()", doc)); 
            }
        }
        catch(Exception e) 
        {
            e.printStackTrace();
        } 
    }
}