= How to debug GeoNetwork = == Debugging Java == The easiest way to debug Java code is to add some logging statements to the code. == Debugging XSLT scripts == Much of !GeoNetwork's functionality is implemented through XSLT scripts that are applied to the XML output of some Java code. It is possible to see that XML output and run an XSLT script on it independently. The best way to do this is to enable Jeeves debugging. In `web/geonetwork/WEB-INF/config.xml`, in the `` section, set `true` and restart !GeoNetwork. Then you can add an exclamation mark (`!`) to the end of the name of a service to view the intermediate XML. For example, if you bring up the !GeoNetwork home page in your browser, the URL will end in `...main.home`. Edit the URL to `...main.home!` and press Enter. The intermediate XML for this page will (eventually) be displayed. You can save this to a file and then use the command-line version of Saxon on it. (For `main.home`, the script to use is `main-page.xsl`, as specified in the `config.xml` file.) == Debugging !JavaScript and HTML in the browser == Changes/additions to layout and interactivity have to be tested in browsers. The means of testing and debugging in a browser varies from browser to browser. === Firefox === * [http://getfirebug.com/ Firebug] gives you tools to debug HTML, CSS, !JavaScript - far too many to list here * [http://chrispederick.com/work/web-developer/ Web Developer] is great for debugging the visual aspects of !GeoNetwork output, e.g., the layout of forms and tables === Internet Explorer === * [http://getfirebug.com/lite.html Firebug Lite] gives you just the console from Firebug, which might be enough to fix a problem * [http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en Internet Explorer Developer Toolbar] provides some Firebug-like tools, but no !JavaScript debugger * Microsoft Script Editor, which comes with Office, provides a full !JavaScript debugger like the one in Firebug. This tool takes up a lot of screen real estate; it's much easier to use if you have a second display.