Locating Document Elements

Finding a consistent location for items that do not display, such as style sheets, symbol libraries, fonts (or other encoded CDATA), and animation elements, can tremendously ease time spent editing a document. By ensuring future editors of your code (this includes you) a dependable location to find certain elements, valuable time can be spent modifying code, not searching for it.

This book's examples utilize a consistent method of organizing document elements. This method organizes content in the following order:

  1. Document data (<?xml>, <!DOCTYPE>, and so forth)

  2. Annotation (<desc>)

  3. Stylesheet (<style>)

  4. Symbol libraries (<defs>, <symbol>, and so forth)

  5. Document content (<rect>, <path>, and so forth)

  6. Animation and interaction ...

Get Sams Teach Yourself SVG in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.