Monday, 20 December 2010

XML-SVG

Describe and discuss Graphical XML – SVG, giving examples.

# SVG stands for Scalable Vector Graphics (SVG). It is a family of specification of an XML based file format for describing 2D graphics, both static and dynamic. Its image and their behaviours are identified in XML text files. Since they are XML files, SVG image cab be created and modified with any text editor. SVG is mostly applied to create graphical web pages and it also could be merged with XUL. To develop graphics for web, it replaces flash. XML numeric data can be twist into graphics by the help of an XSL transformation. In a simple word, it is an XML document with graphical tags. Its output is viewed with an ordinary browser with a plug-in, or a unique viewer with a common browser with a plug-in. It is compatible with HTML 4.0 and XHTML 1.0. It can be used by following:
·         As a individual webpage
·         Embed with the include tags
·         Linked with the link <a> tag.
·         Included by a CSS or XSL property or in XHTML.
For example:
<embed src=”kshitij.svg” type=”image/svg+xml” width=”100” height=”100”>

Following extension can be used on SVG documents:
·         XLink
·         XPointer
·         Stylesheet
·         DOM
            The key idea for motivating SVG was simple to create a generic document-oriented solution for graphics that can be adapted to modern media. As with XML, SVG also lets a developer to organize graphical objects hierarchically in a tree structure. And through inheritance, the grouping and structuring ability offers a great flexibility for both transformation and styling. For instance, some distinct graphical objects (let’s say four) with one single transformation instruction. Likewise, all the objects could be filled with a particular colour by using a single styling instruction at the group level. Moreover, all SVG elements can be given individual XML Ids so they can be reference easily in other parts of the document. So, SVG is not the only possible candidate available, but its integration with other rock-solid XML technologies makes it an ideal fit for ever expanding XML workflows. Below is the simple example for SVG:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC>
<svg width="100%" height="100%" version="1.1"
xmlns="
http://kshitij-palpa.blogspot.com/">
<circle cx="100" cy="50" r="40" stroke="black"
stroke-width="2" fill="red"/>
</svg>


No comments:

Post a Comment