Your immediate assumption is likely to be incorrect. The XML error you encountered, is telling you that the parser encountered your <taskdef>
element in the wrong location within the XML structure. In fact at this point, it hadn't even got around to looking inside the element itself so your classname
attribute can't be the problem.
As Pointy says, try posting the entirety of your XML - or at least, have a look at it yourself and check that the <taskdef>
element is positioned correctly. It needs to be at the top level of the <project>
tag. If you have it nested within other elements, this is not valid and it won't work.
Typically your buildfile might look something like this:
<project name="MyProject" default="dist" basedir=".">
<description>
simple example build file
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<taskdef name="jsdoctoolkit" classname="uk.co.darrenhurley.ant.tasks.JsDocToolkit" classpath="/jsdoc/jsrun.jar;/jsdoc/java/classes/js.jar"/>
<!-- Rest of file... -->
In all cases, if you move your taskdef
line from where it is now, to directly below the <project>
line at the top of the file, I expect this will fix your issue.