An image that is also a readable web document
Ordinarily, if you view the code of an image file in a text editor, the resultant text is completely unintelligible.
Where SVG graphics differ is that they are actually described in a markup style language. SVG is written in Extensible Markup Language (XML), a close relative of HTML. Although you may not realize it, XML is everywhere on the internet. Do you use an RSS reader? That’s XML right there. XML is the language that wraps up the content of an RSS feed and makes it consumable to a variety of tools and services.
So, not only can machines read and understand SVG graphics, but we can too.
Let me give you an example. Take a look at this star graphic:
Figure 10.3: A basic SVG
This is an SVG graphic, called Star.svg
, inside example_10-01
. You can either open this example in the browser where it will appear as the star, or you can open it in a text editor, and you can see the code that generates it. Consider...