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
Dell dumps OpenStack and VMware for public cloud, focuses on private clouds
Pressure mounts for building in security during application development
Corning taps into optical fiber for better indoor wireless
Yahoo on Tumblr: We won't 'screw it up'
How VMware will try to shake up the cloud market this week
Peculiar malware trail raises questions about security firm in India
Reddit IAmA this week to feature Ethernet inventor Bob Metcalfe
US Defense Department approves Apple's iOS devices for its networks
Canadian Tire forgoes BYOD, issues BlackBerries to workers
Smartphones take center stage in two-factor authentication schemes
Researchers uncover new global cyberespionage operation dubbed Safe
iPhone 6 rumor rollup for the week ending May 17
Newvem expands to monitor Azure and Amazon clouds
Forrester: Windows 8 faces uphill battle as corporate desktop
iPad 5 rumor rollup for the week ending May 16
Former Amazon cloud engineer spills to Reddit audience
Jive Software adds integration tool for its enterprise social platform
Lawmakers press Google on Glass privacy
eBay's CIO Succeeds by Innovating and 'Connecting the Dots'
Intel's Krzanich pledges stronger mobile push in his first speech as CEO
Google I/O After Hours: Robot bartenders, augmented reality and Billy Idol
/

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.