when things go wrong, the steps you should take
During more complex SVG projects, such as this project, one regularly runs into errors and developing problems. The following tricks can help during development:
- load the serverside function manually to check if there aren’t any error messages in the generated code, such as PHP error messages. Often the generated code requested is already in error, contains error messages or is not valid or well formed.
- XML is not wellformed: validate the file if things go wrong and you don’t know what’s wrong. In many cases an invalid XML structure is the cause of problems
- Use Batik or other SVG viewers (e.g. Opera9 or MozillaSVG): Apache Batik is an excellent SVG development tool that is stricter in parsing SVG than ASV. This often helps detect problems. It also helps to compare error messages of different SVG viewers
- Use the Batik integrated JavaScript debugger to find errors in the js-code: you need to enable the debugger as follows: Open “Edit” → “Preferences”, go to the “Browser Options” → “Security Settings” tab and turn off “Enforce secure scripting”. Close the preferences window using the “OK” button. Open the debugger with “Tools” → “Script Debugger”. Reload the SVG file to activate the debugger.
- Turn on the “Validating XML parser” in Batik: Go to “Edit” → “Preferences” → “Browser Options” and turn on the “Use a validating XML parser” checkbox
- Use the “Save As” functionality of ASV and Batik to save the current state of the DOM (after script execution and (partial) data-loading) to see if the loaded syntax is correct after receiving data with getURL(). To do so, add the line as a processing instruction after the DOCTYPE declaration. This enables the “Save the actual state of the DOM” function in ASV if you right click in the plugin and use the “Save AS” command. Open it in an XML validator and check the syntax. In Batik (newest CVS version) there is a “Save As” entry in the “File” menu that allows to save the current state of the DOM to a file.
- Ask a SVG discussion group or forum, such as the yahoogroups svg-developers list or the Apache Batik email list
- ask the author of this tutorial for help: but please ONLY after all the other options failed!
Related posts:
About this entry
You’re currently reading “when things go wrong, the steps you should take,” an entry on Geoinformatics
- Published:
- 5.2.06 / 5下午
- Tags:
- SVG
Ajax ArcGIS China Dreams Flex Geography Geoinformatics GeoRSS GIS Google Hardware Harvard Historical Geography History Jquery Life Linux Love Map MapServer NASA Neo-Confucianism OGC OpenGIS OpenSource OSGeo PHP Politics PostGIS PostgreSQL PROJ4 Python R RS Song SVG Ubuntu Web WebGIS Wordpress
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.















赵 博 (Bo Zhao),
参与或主持的项目
No comments
Jump to comment form | comments rss [?] | trackback uri [?]