- Overview
- Attribute types
- svf
- head
- body
Overview
The XML version of SVF contains the same information as the binary version.
It has many of the same concepts such as placing information necessary for
display in the head and current state.
See the SVF Specification for more information.
Attribute types
Coordinates and Distances
Coordinates and distances can be specified as floating point values.
As with binary SVF, these values can be integers that are run through
a transformation. See the transform element
for more information.
Angles
Angles are specified in degrees counterclockwise from the positive x axis.
They may be integers or floating point values.
Colors
Colors are always specified as rgb (red/green/blue) triplets in hexadecimal
starting with a '#' symbol. Each color value ranges from 0, dark, to #ff
(255), brightest. The following examples illustrate.
<color color="#000000"/> <!-- black -->
<color color="#ffffff"/> <!-- white -->
<color color="#ff0000"/> <!-- pure red -->
<color color="#00ff00"/> <!-- pure green -->
<color color="#0000ff"/> <!-- pure blue -->
<color color="#909090"/> <!-- grey -->
|
Elements
The descriptions of the elements contain a pointer to the relevent portion
of the SVF Specification, syntax rules, and sample XML.
svf
<svf></svf> surrounds the entire SVF file. It starts with an
optional head followed by the body.
Note that the <body> wrapper tags are optional.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svf PUBLIC "-//SVFORG//DTD SVF 2.0//EN"
"http://www.softsource.com/svf/svf.dtd">
<svf>
<line point="1,1" point2="4,3"/>
</svf>
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svf PUBLIC "-//SVFORG//DTD SVF 2.0//EN"
"http://www.softsource.com/svf/svf.dtd">
<svf>
<head>
<extents min="0,0" max="5,5"/>
</head>
<body>
<line point="1,1" point2="4,3"/>
</body>
</svf>
|
head
There should only be a single <head></head> section in an
SVF file. It comes before all other information and contains information
necessary for organizing and interpreting the rest of the content of the file.
<svf>
<head>
<transform base="20,30" scale="0.00015"/>
<extents min="0,0" max="62000,50000"/>
<layers count="2">
<layer name="a layer"/>
<layer name="another layer" state="off"/>
</layers>
</head>
<line layer="another layer" point="1,1" point2="4,3"/>
</svf>
|
background
<!ELEMENT background EMPTY>
<!ATTLIST background
color CDATA #REQUIRED>
|
See color in the
SVF Specification for more information.
<background color="#302a32"/>
|
colors
<!ELEMENT colors (color+)>
<!ELEMENT color EMPTY>
<!ATTLIST colors
count CDATA #IMPLIED
background CDATA #IMPLIED
transparent CDATA #IMPLIED>
<!ATTLIST color
color CDATA #REQUIRED>
|
background and transparent
are stand-alone elements which can take the place of the corresponding attributes
for the colors element.
See color in the
SVF Specification for more information.
<colors count="4">
<color color="#000000"/>
<color color="#ffffff"/>
<color color="#f02031"/>
<color color="#80003f"/>
</colors>
|
datatypes
<!ELEMENT datatypes (datatype+)>
<!ELEMENT datatype EMPTY>
<!ATTLIST datatypes
count CDATA #IMPLIED>
<!ATTLIST datatype
company CDATA #IMPLIED
type CDATA #REQUIRED
comments CDATA #IMPLIED
href CDATA #IMPLIED>
|
See custom user data in the
SVF Specification for more information.
<datatypes count="3">
<datatype company="My Company" type="My DataType"
comments="This is for testing"
href="http://mycompany.com/MyDataType.html"/>
<datatype company="My Company" type="My Second DataType"/>
<datatype company="Another Company" type="Another Type"/>
</datatypes>
|
extents
<!ELEMENT extents EMPTY>
<!ATTLIST extents
min CDATA #IMPLIED
max CDATA #REQUIRED>
|
See extents in the
SVF Specification for more information.
<extents min="0,0" max="62000,50000"/>
|
flags
<!ELEMENT flags EMPTY>
<!ATTLIST flags
rearrange (true|false|on|off) "true"
upperleft (true|false|on|off) "true">
|
See flags in the
SVF Specification for more information.
fonts
<!ELEMENT fonts (font+)>
<!ELEMENT font EMPTY>
<!ATTLIST fonts
count CDATA #IMPLIED>
<!ATTLIST font
font CDATA #REQUIRED
family (monospaced|sansserif|serif|symbol|cursive|fantasy|other) "serif">
|
See fonts in the
SVF Specification for more information.
<fonts count="5">
<font font="Some Font" family="other"/>
<font font="Times New Roman" family="serif"/>
<font font="Arial" family="sansserif"/>
<font font="Courier" family="monospaced"/>
<font font="WingDings" family="symbol"/>
</fonts>
|
initialview
<!ELEMENT initialview EMPTY>
<!ATTLIST initialview
min CDATA #IMPLIED
max CDATA #REQUIRED>
|
See views in the
SVF Specification for more information.
<initialview min="40,50" max="2000,5000"/>
|
layers
<!ELEMENT layers (layer+)>
<!ELEMENT layer EMPTY>
<!ATTLIST layers
count CDATA #IMPLIED>
<!ATTLIST layer
name CDATA #REQUIRED
state (true|false|on|off) "on">
|
See layers in the
SVF Specification for more information.
<layers count="2">
<layer name="a layer"/>
<layer name="another layer" state="off"/>
</layers>
|
name
<!ELEMENT name EMPTY>
<!ATTLIST name
name CDATA #REQUIRED>
|
See name in the
SVF Specification for more information.
nextid
<!ELEMENT nextid EMPTY>
<!ATTLIST nextid
id CDATA #REQUIRED>
|
See object ids in the
SVF Specification for more information.
<nextid id="#32ff0042ae"/>
|
notifications
<!ELEMENT notifications (zoomin?, zoomout?)>
<!ELEMENT zoomin (notify+)>
<!ELEMENT zoomout (notify+)>
<!ELEMENT notify EMPTY>
<!ATTLIST zoomin
count CDATA #IMPLIED>
<!ATTLIST zoomout
count CDATA #IMPLIED>
<!ATTLIST notify
width CDATA #REQUIRED
href CDATA #REQUIRED>
|
See notifications in the
SVF Specification for more information.
<notifications>
<zoomin count="2">
<notify href="http://whatever.com" width="50000"/>
<notify href="http://com.com/file.html" width="10000"/>
</zoomin>
<zoomout count="1">
<notify href="layeron=a layer" width="10000"/>
</zoomout>
</notifications>
|
size
<!ELEMENT size EMPTY>
<!ATTLIST size
width CDATA #REQUIRED>
|
See size in the
SVF Specification for more information.
transform
<!ELEMENT transform EMPTY>
<!ATTLIST transform
scale CDATA #IMPLIED
base CDATA #IMPLIED>
|
See transformations in the
SVF Specification for more information.
<transform base="20,30" scale="0.00015"/>
|
transparent
<!ELEMENT transparent EMPTY>
<!ATTLIST transparent
color CDATA #REQUIRED>
|
See color in the
SVF Specification for more information.
views
<!ELEMENT views (view+)>
<!ELEMENT view EMPTY>
<!ATTLIST views
count CDATA #IMPLIED>
<!ATTLIST view
name CDATA #IMPLIED
min CDATA #REQUIRED
max CDATA #REQUIRED>
|
See view descriptions in the
SVF Specification for more information.
<views count="2">
<view name="a view" min="400,123" max="34567,31762"/>
<view name="another view" min="100,100" max="200,200"/>
</views>
|
body
The body follows the optional head and contains the
content of the file. Note that wrapping the body with <body></body>
is optional.
All the graphic entities can specify general
properties. Curves can specify some specific
properties. Current properties can also be changed by the non-displaying
current tag. With most graphic objects, if you don't
specify an initial point, it will assume it starts from the current point.
a
<!ELEMENT a (%bodyobjects;)*>
<!ATTLIST a
href CDATA #REQUIRED
title CDATA #IMPLIED
target CDATA #IMPLIED
dimension (1|2) "2"
query (true|false|on|off) "false"
shortform (true|false|on|off) "false"
base CDATA #IMPLIED
scale CDATA #IMPLIED>
|
If query="true", a query string is tacked on to the href URL string.
If addwidth, base, roundoff or scale is
specified, query is assumed to be true.
See hyperlinks in the
SVF Specification for more information.
<a href="http://whatever.com/file.html" dimension="1">
<rectangle point="18000,15000" width="1000" height="2000"/>
<circle point="3000,2000" radius="10000"/>
</a>
<a href="http://whatever.com/file.html" base="-4.3,-7.9" scale="0.0034,-0.0034">
<rectangle point="18000,15000" width="1000" height="2000"/>
</a>
|
arc
<!ELEMENT arc EMPTY>
<!ATTLIST arc
point CDATA #IMPLIED
radius CDATA #REQUIRED
startangle CDATA #REQUIRED
endangle CDATA #REQUIRED>
|
See arcs in the
SVF Specification for more information.
<arc point="3.21,4.32" radius="3.97" startangle="340" endangle="30">
|
bezier
<!ELEMENT bezier EMPTY>
<!ATTLIST bezier
point CDATA #IMPLIED
point2 CDATA #REQUIRED
point3 CDATA #REQUIRED
point4 CDATA #REQUIRED>
|
See bezier curves in the
SVF Specification for more information.
<bezier point="2.703,2.2545" point2="4.62,8.45" point3="9.33,4.44" point4="5.42,7.91"/>
|
circle
<!ELEMENT circle EMPTY>
<!ATTLIST circle
point CDATA #IMPLIED
radius CDATA #REQUIRED>
|
See circles in the
SVF Specification for more information.
<circle point="21380,28770" radius="10000"/>
|
clipping
<!ELEMENT clipping (%bodyobjects;)*>
<!ATTLIST clipping
count CDATA #IMPLIED>
|
See clipping in the
SVF Specification for more information.
<clipping count="1">
<rectangle point="10,10" width="1000" height="2000"/>
</clipping>
|
current
<!ELEMENT current EMPTY>
<!ATTLIST current
<!-- general properties -->
color CDATA #IMPLIED
id CDATA #IMPLIED
layer CDATA #IMPLIED
transform (true|false|on|off) "on"
visibility (true|false|on|off) "on"
<!-- curve properties -->
fill (true|false|on|off) "off"
fixedwidth CDATA #IMPLIED
linetype (solid|dash|dot|dashdot|dashdotdot) "solid"
penwidth CDATA #IMPLIED
point CDATA #IMPLIED
<!-- text properties -->
text-angle CDATA #IMPLIED
text-font CDATA #IMPLIED
text-height CDATA #IMPLIED
text-bold (true|false|on|off) "false"
text-italics (true|false|on|off) "false"
text-base-method (baseline|bottom) "baseline"
text-height-method (M|cell) "M"
text-underline (true|false|on|off) "false">
|
See object properties in the
SVF Specification for more information.
<current color="#ff00ff" layer="a layer" id="#4e39"
visibility="off" transform="on" penwidth="4.23"
fill="off" linetype="dashdot"/>
<current fixedwidth="100"/>
|
data
<!ELEMENT data (#PCDATA)*>
<!ATTLIST data
format CDATA 'binary'
type CDATA #IMPLIED
company CDATA #IMPLIED>
|
In general, the type attribute should be specified and will
correspond to an entry in the datatypes table in
the head. It is optional to retain compatibility
with SVF1.1 which didn't allow for a type to be specified.
See custom user data in the
SVF Specification for more information.
<data>
32ff0042ae
</data>
<data type="My Second DataType">
32ff0042ae
</data>
|
ellipse
<!ELEMENT ellipse EMPTY>
<!ATTLIST ellipse
point CDATA #IMPLIED
width CDATA #REQUIRED
height CDATA #REQUIRED
angle CDATA #IMPLIED
startangle CDATA #IMPLIED
endangle CDATA #IMPLIED>
|
See ellipses in the
SVF Specification for more information.
<ellipse point="36113,52703" width="10000" height="5000"/>
<ellipse point="5.42,7.91" width="3.21" height="6.77" angle="314"/>
<ellipse point="5.42,7.91" width="5.43" height="2.718"
angle="45" startangle="96" endangle="97"/>
|
line
<!ELEMENT line EMPTY>
<!ATTLIST line
point CDATA #IMPLIED
point2 CDATA #REQUIRED>
|
See lines in the
SVF Specification for more information.
<line point="4000,5000" point2="20000,21000"/>
<line point2="19790,28459"/>
|
object
<!ELEMENT object (#PCDATA)*>
<!ATTLIST object
point CDATA #IMPLIED
width CDATA #REQUIRED
height CDATA #IMPLIED
data CDATA #REQUIRED
type CDATA #IMPLIED>
|
See bitmaps and other objects in the
SVF Specification for more information.
<object data="http://somewhere.com/picture.jpg" point="5000,4000" width="4444">
appears if bitmap can't be displayed
</object>
<object data="index.html" point="2,3" width="1.5" type="text/html"></object>
|
point
<!ELEMENT point EMPTY>
<!ATTLIST point
point CDATA #REQUIRED>
|
See points in the
SVF Specification for more information.
<point point="1.41421,1.73205"/>
|
polyline
<!ELEMENT polyline EMPTY>
<!ATTLIST polyline
points CDATA #REQUIRED
count CDATA #IMPLIED>
|
See polylines in the
SVF Specification for more information.
<polyline points="7.09995,0.915 5.77995,5.475 9.28995,-0.045"/>
|
rectangle
<!ELEMENT rectangle EMPTY>
<!ATTLIST rectangle
point CDATA #IMPLIED
width CDATA #REQUIRED
height CDATA #REQUIRED>
|
See rectangles in the
SVF Specification for more information.
<rectangle point="36113,52703" width="1000" height="2000"/>
|
stream
<!ELEMENT stream EMPTY>
<!ATTLIST stream
status (end|reset) #REQUIRED>
|
See Stream Status in the
SVF Specification for more information.
text
<!ELEMENT text (#PCDATA)*>
<!ATTLIST text
point CDATA #IMPLIED
width CDATA #IMPLIED>
|
See text in the
SVF Specification for more information.
<current text-height="4000"/>
<text point="36113,52703">this is text</text>
<current text-angle="45" text-font="Arial"/>
<text point="31113,52703" width="15000">more text</text>
|