• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Syntax

This chapter looks at how the source code of an SVG image is structured. All SVG images, which are also SVG documents or document fragments, are also XML-compliant documents.

If you don’t understand how XML syntax—and, therefore, SVG syntax—works, you can end up with endless frustration because an SVG viewer may not display any (or only parts) of your SVG image, if it isn’t properly structured. That isn’t surprising. Suppose that you are reading the instructions for the construction or configura-tion of a new gadget and you read, “Diggle the windlejump so that it is lineared upside the kindlespan.” What do you do, apart from uttering some bad words or throwing the gadget out the window? You are probably stuck. If you don’t structure your SVG documents properly, an SVG viewer has much the same problem: It stops. (It usually doesn’t swear, though it may provide a helpful error message.) The worst message an SVG viewer has returned to me is “Junk after the document element,” which I took to mean that I had made a major error (and I had).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint