Search /
Docfinder:
Advanced search  |  Help  |  Site map
RESEARCH CENTERS
SITE RESOURCES
Click for Layer 8! No, really, click NOW!
Networking for Small Business
TODAY'S NEWS
Valentine's Day Patch Tuesday: Microsoft to issue 9 patches, 4 critical
Mobile World Congress sneak peek: Quad-core smartphones, Ice Cream Sandwich & more
Microsoft details 'Windows on ARM' program
March debut of 'iPad 3' a sure bet, says analyst
FBI unbolts Steve Jobs 1991 investigation file
Cisco boosted profit, sales in Q2 while cutting costs
Macs take on the enterprise
Four crazy tech ideas from Google's Solve for X project
Obama 2012 campaign playlist revealed courtesy of Spotify
Oracle buying Taleo for US$1.9 billion in direct hit at SAP
Amazon attacks Apple: You get 3 Kindle products for price of iPad 2
Pre-rendered pages highlight latest Google Chrome release
Microsoft exec: Lync-Skype integration a 'compelling opportunity'
The future of hypervisors
/

Cool graphics in XML

Gearhead archive

The entire universe is going XML. Everywhere you turn, somebody is turning something into XML. This is, as Ms. Stewart is wont to say, "A good thing."

The beauty of XML is it provides a whole new way of structuring "stuff" that goes beyond just organizing data. With XML, data is imbued with meaning and purpose . . . wait a minute, that implicitly makes it information. Cool.

Today, we'll look at one of the latest and most promising applications of XML - Scalable Vector Graphics (SVG).

SVG is currently a W3C Candidate Recommendation (see www.w3.org/TR/SVG/) under the name "Scalable Vector Graphics (SVG) 1.0 Specification" and dated Nov. 2, 2000. The abstract of the specification summarizes SVG as "a language for describing two-dimensional vector and mixed vector/raster graphics in XML."

Sounds pretty dry, doesn't it? In fact, SVG is terribly exciting if you're inclined toward trying whiz-bang graphics on the Web. If you're not, SVG is cool anyway.

The reason for such coolness is what SVG can do. Quoting the W3C specification: "SVG allows for three types of graphic objects: vector graphic shapes (e.g., paths consisting of straight lines and curves), images and text. Graphical objects can be grouped, styled, transformed and composited into previously rendered objects. The feature set includes nested transformations, clipping paths, alpha masks, filter effects and template objects. SVG drawings can be interactive and dynamic. Animations can be defined and triggered declaratively (that is, by embedding SVG animation elements in SVG content) or via scripting."

SVG has a document object model that provides access to all elements, attributes and properties in an SVG graphic document. There are also event handlers such as the ever-popular "onmouseover" and "onclick."

SVG's MIME type will be "image/svg+xml" when the W3C registers it as such - apparently around the time when SVG is approved as a W3C recommendation (no date set). The specification also recommends that SVG files should have the extension ".svg" (all lower case) on all platforms.

OK, enough of the dry stuff. Let's cut code! Here's an example of an SVG document:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd">
<svg xml:space="preserve" width= "3in" height="3in">
<text style="fill:blue;" y="15">Gearhead was here.</text> <text font-family="serif" font-size="12pt" fill="black" x="0" y="0" transform="rotate(-90) translate(-100, 180) scale(1.5, 1)">
Cool.
</text>
</svg>

To see what this code does, install the Adobe SVG viewer (it's free from Adobe) in Internet Explorer. Next, put the above code in a file called test1.svg and load it into your browser.

Next week, we'll explain what's going on. Revelations to gearhead@gibbs.com.

RELATED LINKS

Comments and suggestions to gh@gibbs.com.

Gibbs Forum
The place to discuss Gibbs's columns.

Check out this week's edition of

Backspin for more musings from Gibbs.


NWFusion offers more than 40 FREE technology-specific email newsletters in key network technology areas such as NSM, VPNs, Convergence, Security and more.
Click here to sign up!
New Event - WANs: Optimizing Your Network Now.
Hear from the experts about the innovations that are already starting to shake up the WAN world. Free Network World Technology Tour and Expo in Dallas, San Francisco, Washington DC, and New York.
Attend FREE
Your FREE Network World subscription will also include breaking news and information on wireless, storage, infrastructure, carriers and SPs, enterprise applications, videoconferencing, plus product reviews, technology insiders, management surveys and technology updates - GET IT NOW.