When using the following task in ant:
<tidy destdir="XYZ">
<fileset dir="XYZ">
<include name="*.html"/>
</fileset>
...
I am getting:
java.lang.NullPointerException
at org.w3c.tidy.ParserImpl.parseDocument(Unknown Source)
at org.w3c.tidy.Tidy.parse(Unknown Source)
at org.w3c.tidy.Tidy.parse(Unknown Source)
at org.w3c.tidy.ant.JTidyTask.processFile(Unknown Source)
at org.w3c.tidy.ant.JTidyTask.executeSet(Unknown Source)
at org.w3c.tidy.ant.JTidyTask.execute(Unknown Source)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
When using
<tidy destdir="DIFFERENT"> <fileset dir="XYZ"> <include name="*.html" /> </fileset>
...
jtidy works fine. For my scenario, it would be great if JTidy could handle the same target as source dir (itself creating temporary files when necessary). Or if it would raise a better error.
I'm not familiar with the ant task, however tidy has a "writeback" option, are you able to use it and does it fix the problem?