How to debug GeoNetwork
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.
web/geonetwork/WEB-INF/config.xml, in the
<debug>true</debug> 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
...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
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.
- Web Developer is great for debugging the visual aspects of GeoNetwork output, e.g., the layout of forms and tables
- Firebug Lite gives you just the console from Firebug, which might be enough to fix a problem