SVG/XML & THE DOM : JAVASCRIPT METHODS & EXAMPLES
Applied within the Adobe SVG Viewer(ASV 3.03) and Internet Explorer Environment (IE6/7/8)

Data-driven graphics is a seamless application for SVG. Its natural linkage to XML data files can create and dynamically change SVG elements. This provides a graphic display representing the data. Methods of interlacing XML data and SVG elements are presented herein.

USING XML TO DYNAMICALLY CREATE SVG
Last Updated: 05/19/2009

SVG/XML-DOM REFERENCE - This is an evolving core reference for those that are using the XML & SVG DOM to access and modify SVG elements and their attributes within the Adobe SVG Viewer. Choosing a method will 'run' the method function, show the related javascript code, and its resultant svg source.

DYNAMIC SVG EXAMPLES - The examples demonstrate XML/SVG creating dynamic SVG, plus also present application concepts. Selecting an example will 'run' the example function, show the related javascript code, and its resultant svg source. Examples include communication to/from the server, using lean & clean Classic ASP, performing elegant xml file adjustments.

MEET THE CAST - To simplify the examples, a few SVG elements have been created and named. Firstly, there's Godfather, otherwise known as the SVG document. Then there are three(3) teenage characters; "Shifty", "Smiley", and "Rosie", living at their Apartment, located in the 'Hood. They've volunteered to participate.

Javascript Functions
 
SVG Source
(drag/drop at border )(drag/drop at border )

Additional Javascript SVG Applications and Examples
SVG Spirals The SVG spiral path and its applications with XML.
The SVG Path Learn, create, and edit SVG paths; with example templates.
Matrix Transformations Using Javascript to create SVG matrix transforms
SVG Symbol Library Create symbols and deploy their use elements
Global Map of Avian Flu SVG graphics are created from an XML database.
Bubbles~n~Boxes SVG drawings created from basic SVG elements.
Svg Icons an application containing over 250 customizable icons.
Unicode Font Icons Create over 4000 icons from Unicode SVG path images.
SVGtrace Trace SVG curved paths over a background image
SVGdiscovery An SVG Drawing Tool: Apply the powerful native scalability of SVG to its fullest advantage


CLIENT-SIDE vs SERVER : rationale - When compared to a server, client computers are under-employed after the base document is loaded from the web. Therefore, first loading a lightweight base SVG document, then propagating it via tight XML files, building SVG elements client-side, is preferred over calling them from the server.

QUESTIONS AND COMMENTS - Please contact me via email, or post comments, suggest examples, and discuss any related item at the Yahoo group: SVGdiscovery

Author's Note: The code herein attempts to concisely present an example or concept, without regard to error trapping, other validation clutter, or wigetry ;). All code in these examples can be used without restrictions.

Author: © Francis Hemsher /