Title:
System and method for extending scalable vector graphics capabilities
Document Type and Number:
Kind Code:
A1

Abstract:
A system for extending interactivity of a presentation markup language is provided. The system comprises a collection of designated elements, and a collection of associated instructions for performing functions on elements in the document object model. Each designated element comprises a namespace, and attributes for describing features of the designated element. The instructions associated with the designated elements.

Representative Image:
Inventors:
Bowman, Gordon (Kemptville, CA)
Barrett, Peter (Ottawa, CA)
      Plaque It!

Sponsored by:
Flash of Genius
Application Number:
10/678842
Publication Date:
06/10/2004
Filing Date:
10/03/2003
View Patent Images:
Images are available in PDF form when logged in. To view PDFs, Login  or  Create Account (Free!)
Assignee:
COREL CORPORATION
Primary Class:
Other Classes:
715/255
International Classes:
(IPC1-7): G06F015/00
Attorney, Agent or Firm:
Hayes Soloway, Norman Soloway P. C. P. (130 W. Cushing Street, Tucson, AZ, 85701, US)
Claims:

What is claimed is:



1. A system for extending interactivity of a presentation markup language, the system comprising: a collection of designated elements, each designated element comprising: a namespace; and attributes for describing features of the designated element; and a collection of associated instructions for performing functions to elements in the document object model, the instructions associated with the designated elements.

2. The system as claimed in claim 1, further comprising an initialization function for directing the processing one or more designated elements in the document object model, having instructions for traversing each node in the document object model and for searching and calling functions associated with designated elements having names following a predetermined naming convention.

3. The system as claimed in claim 1, wherein the designated element is associated with an extensible markup language element.

4. The system as claimed in claim 1, further comprising: a collection of designated attributes applied to one or more of the document object model elements for applying passive behavior to objects in the web application; and a collection of associated instructions for performing functions associated with the designated attributes.

5. The system as claimed in claim 4, wherein the collection of designated attributes comprises one or more of: a ‘drag’ attribute for specifying whether the element is movable by clicking and dragging it with the mouse; a ‘pan’ attribute for specifying whether the element is immune to panning; a ‘zoom’ attribute for specifying whether the element is immune to zooming; a ‘selected’ attribute for specifying whether the element has been selected; and a ‘selectionGroup’ attribute for specifying an ‘id’ attribute of a <selection> element that this element is associated with.

6. The system as claimed in claim 1, wherein the collection of designated elements comprises one or more of: flow control elements for controlling statement flow of the web application; coordinate mapping elements for manipulating coordinates of objects in the web application; behavior elements for manipulating viewer behavior with respect to the web application; a focus element for selecting a group of elements in the web application; and a constraint element for constraining manipulable attributes of an element in a web application.

7. The system as claimed in claim 6, wherein the flow control elements comprise one or more of: an if element for defining a simple conditional statement which, when it evaluates to true, results in its child elements being executed or rendered; a switch element for defining a conditional statement, and for comparing one value to other values defined in child <case> elements; a case element for defining the value to compare to a ‘value’ attribute of the switch element; a default element for containing action elements to be executed; and a loop element for defining a repeated sequence of actions.

8. The system as claimed in claim 6, wherein the coordinate mapping elements comprise one or more of: a mousePosition element for defining a container for holding current mouse coordinates; a mapCoords element for defining an object used for mapping coordinates in one space to another space, via a polynomial transformation, whose coefficients are determined by the coordinates of point-pairs; a pointPair element for defining x-y coordinates for a same location in two different coordinate spaces; and a mapProj element for defining an object used for mapping coordinates in one projection system to another.

9. The system as claimed in claim 6, wherein the viewer behavior elements comprise one or more of: a zoom element for scaling a document by a factor; a pan element for translating a document by an amount; and a playSound element for playing an audio file.

10. A method of extending interactivity of presentation markup languages, the method comprising one or more of the following: controlling statement flow of a web application, the method comprising the steps of: searching for a flow control element in a document object model of the web application; generating a function name associated with the flow control element; calling the generated function name; and processing child elements of the flow control element; coordinate mapping of a web application, the method comprising the steps of: searching for a coordinate mapping element in a document object model of the web application; generating a function name associated with the coordinate mapping element; and calling the generated function name; manipulating viewer behavior with respect to a web application, the method comprising the steps of: searching for a viewer behavior element in a document object model of the web application; generating a function name associated with the viewer behavior element; and calling the generated function name; focussing a group of elements in a web application, the method comprising the steps of: searching for a focus element in a document object model of the web application; generating a function name associated with the focus element; and calling the generated function name; constraining manipulable attributes of an element in a web application, the method comprising the steps of: searching for a constraint element in a document object model of the web application; generating a function name associated with the constraint element; and calling the generated function name; and applying passive behavior to an element of a web application, the method comprising the steps of: searching for a designated attribute of the element in a document object model of the web application; generating a function name associated with the designated attribute; and calling the generated function name.

11. A method of extending interactivity of a presentation markup language, the method comprising the steps of: searching for a designated control element in a document object model; and calling a function associated with the designated control element.

12. The method as claimed in claim 11, wherein the step of searching includes the steps of: traversing each node in the document object model; and determining whether an element has a name which follows a designated naming convention.

13. The method as claimed in claim 11, wherein the step of calling a function includes the steps of: dynamically generating a function name associated with the designated element; passing an object associated with the designated element as a parameter of the generated function; retrieving the attributes of the object; and performing a function stored in memory having the generated function name.

14. The method as claimed in claim 13, wherein the step of dynamically generating includes the steps of: determining if the name of the designated element contains a designated prefix; generating a function name comprising of the name of the designated element; assigning an object associated with the designated element as the parameter of the function; and assigning predetermined instructions of the designated element as steps for the function to perform.

15. The method as claimed in claim 11, wherein the step of calling a function includes the steps of: determining which script in a collection of scripts is associated with the designated element; and calling the script.

16. The method as claimed in claim 11, further comprising the steps of: searching for a designated attribute in an element in a document object model; and calling a script associated with the designated attribute.

17. The method as claimed in claim 16, wherein the step of searching for a designated attribute comprises the steps of: searching attributes of an element in a document object model; determining whether an element attribute has a name which follows a designated naming convention.

18. The method as claimed in claim 16, wherein the step of calling a script includes the steps of: determining if the name of the designated attribute contains a designated prefix; generating a function name comprising of the name of the designated attribute; assigning an object associated with the designated attribute as the parameter of the function name; and assigning predetermined instructions of the designated attribute as steps for a function having the function name to perform.

19. The method as claimed in claim 16, wherein the step of calling a script includes the steps of: dynamically generating a function name associated with the designated attribute; passing an object associated with the designated attribute as a parameter of the generated function name; receiving the attributes of the object; and performing a function stored in memory having the generated function name.

20. The method as claimed in claim 19, wherein the step of dynamically generating comprises the steps of: determining if the name of the designated attribute contains a designated prefix; generating a function name comprising of the name of the designated attribute; assigning an object associated with the designated attribute as the parameter of the function; and assigning predetermined instructions of the designated attribute as steps for the function to perform.

21. The method as claimed in claim 19, wherein the step of calling a script includes the steps of: determining which script in a collection of scripts is associated with the designated attribute; and calling the script.

22. A method of extending interactivity of a presentation markup language by controlling user interface features of a web application, the method comprising the steps of: adding a behavior element as a child of a designated element; receiving an event which is equal to an event attribute setting in the behavior element; and calling a script associated with the behavior element.

Description:

FIELD OF THE INVENTION

[0001] The invention relates to web application development. In particular, the invention relates to a system and method for extending scalable vector graphics capabilities.

BACKGROUND OF THE INVENTION

[0002] Scalable Vector Graphics (SVG) has the potential to become the platform (markup language) of choice for building robust, dynamic and interactive web applications. However, SVG lacks many features that are desired for building such web applications. Features that are missing in SVG include coordinate mapping, projection mapping, mouse tracking, zooming, panning, selection ability, flow control, moving objects, zoom/pan immunity, and constraints.

[0003] Since these features are missing from SVG, building robust web applications requires extensive scripting. For example, a scripting language such as European Computer Manufacturers Association Script (ECMAScript) is required. There are many problems with using script. One problem is the fact that most web designers do not have the programming skills required for scripting.

[0004] One way to manipulate a DOM is to use scripting. However, many web designers do not have the programming skills required for DOM manipulation via scripting. Thus, programmers are needed to create the scripts for the designer. Programmers can be costly, plus it can take a long time to develop stable, fast code. Thus, it is desirable to have a system or method of manipulating a DOM that a designer with minimal programming knowledge may operate, and which could also aid even an experienced programmer to rapidly develop a web application.

[0005] One way of assisting designers and developers is to have pre-canned scripts for the most commonly required functionality. However, script is difficult to auto-generate. Supporting the insertion of pre-canned scripts via an integrated development environment (IDE) is both complicated and limiting. For example, the Microsoft (™) Visual Studio IDE can create auto-generated code for its Microsoft Foundation Classes (MFC) (which abstract the programmer from the core Win32 API's), making it easier and quicker to program Windows applications. However, limits must be imposed on the user. User-modification of the auto-generated code is discouraged, because it makes it difficult to regenerate the code from the project file, or to automatically modify the pre-generated code as a result of new user-defined parameters to the abstractions. Auto-generated script cannot easily be customized afterwards, unless the IDE absolves itself of all responsibility should the designer make modifications.

[0006] Software exists that allows one to map input XML markup to output markup, automatically generating extensible stylesheet language transformation XSLT (the most commonly used XML markup language for transforming XML markup to a different form of markup). However, script is difficult to data-map.

[0007] Script relies on full DOM support. Scripts are only as powerful as the DOM methods that the viewer supports. Although it is desirable to have all viewers support the entire spectrum of DOM methods, they currently do not. Thus one must write script that only uses the API's supported by all viewers, in order to ensure that the script works on all viewers (i.e., one must program towards the lowest common denominator).

[0008] Script is complex. Abstracting the DOM methods using dSVG markup has allowed for the creation of a more direct linkage between the syntax and the intent of the author. Take the example of a designer creating a new element dynamically in the DOM. The designer wishes to create a circle at a particular location in the DOM tree. To do it in script is quite complicated, requiring over a hundred lines of code. One must first use getElementById( ) to find the target element, and then either the parent or sibling element. One then uses createElement( ) to create the circle. If inserting beneath a parent, parent.appendChild( ) is used. If inserting before a sibling, sibling.insertBefore( ) is used. If inserting after a sibling sibling.nextSibling.insertBefore( ) is used, unless there is no nextSibling, in which case sibling.parentNode.appendChild( ) is used. The author may wish to insert it as, say, the fourth sibling from the top or bottom, requiring a loop to be written which counts the siblings and accounts for the fact that maybe there are not that many siblings. Or the author may wish the new element to be the parent of existing elements, which requires removal of those elements and appending them as the children of the new one. Then finally setAttribute( ) is used to set its identifier (ID) so that you can refer to it later.

[0009] Script is slower than native code. Scripts are interpreted, and thus provide slower performance than what would be possible with a natively-implemented markup language. Just having a script interpreter is a lot of overhead for a small device.

[0010] Script must use DOM interfaces. Scripts can only manipulate the DOM via the DOM methods, which are abstractions on top of the real object model used by the viewer. Natively-implemented markup could access the real object model directly, which may improve performance even more.

[0011] Script requires more data to transfer. Scripts greatly add to the amount of data needed to be transferred. This is a problem especially for small devices.

[0012] Finally, scripts are only as powerful as the DOM API's that the viewer supports. Currently, not all viewers support the entire spectrum of DOM API's. Thus, in order to ensure that the script will work on all viewers, one must write script that only uses the API's supported by all viewers.

[0013] The algorithm for determining the polynomial coefficients from a series of point-pairs is known as Singular Value Decomposition, which solves, in a least square sense, the overdetermined set of equations:

x i ′=Ax i +By i +C

y i ′=Dx i +Ey i +F

[0014] given 3 or more coordinate pairs {x i ′, y i ′; x i , y i }.

[0015] There exists software that has user interface (UI) for creating the point-pairs as well as a macro language for pulling the point-pairs in from a file, calculating the coefficients and transforming one coordinate space to another. The software can also convert between many different projection systems, using known algorithms. This software, however, does not support an XML markup language.

SUMMARY OF THE INVENTION

[0016] It is an object of the invention to provide a novel system and method of manipulating a document object model that obviates or mitigates at least one of the problems described above.

[0017] In an aspect of the present invention, there is provided a system for extending interactivity of presentation markup languages. The system comprises a collection of designated elements, a collection of associated instructions for performing functions on elements in the document object model, the instructions associated with the designated elements, and an initialization function for directing the processing of one or more designated elements in the document object model. Each designated element comprises a name following a predetermined naming convention, and attributes for describing features of the designated element.

[0018] In another aspect of the present invention, there is provided a method of extending interactivity of presentation markup languages. The method comprises one or more of controlling statement flow of a web application, coordinate mapping of a web application, manipulating viewer behavior with respect to a web application, focussing a group of elements in a web application, constraining manipulable attributes of an element in a web application, and applying passive behavior to an element of a web application.

[0019] The controlling statement flow of a web application method comprises the steps of searching for a flow control element in a document object model of the web application, generating a function name associated with the flow control element, calling the generated function name and processing child elements of the flow control element.

[0020] The coordinate mapping of a web application method comprises the steps of searching for a coordinate mapping element in a document object model of the web application, generating a function name associated with the coordinate mapping element, and calling the generated function name.

[0021] The manipulating viewer behavior with respect to a web application method comprises the steps of searching for a viewer behavior element in a document object model of the web application, generating a function name associated with the viewer behavior element, and calling the generated function name.

[0022] The focussing a group of elements in a web application method comprises the steps of searching for a focus element in a document object model of the web application, generating a function name associated with the focus element, and calling the generated function name.

[0023] The constraining manipulable attributes of an element in a web application method comprises the steps of searching for a constraint element in a document object model of the web application, generating a function name associated with the constraint element, and calling the generated function name.

[0024] The applying passive behavior to an element of a web application method comprising the steps of searching for a designated attribute of the element in a document object model of the web application, generating a function name associated with the designated attribute, and calling the generated function name.

[0025] In another aspect of the present invention, there is provided a method of extending interactivity of presentation markup languages. The method comprises the steps of searching for a designated control element in the document object model, and calling a function associated with the designated control element.

[0026] In another aspect of the present invention, there is provided a method of controlling features of a web application. The method comprises the steps of adding a behavior element as a child of a designated element, receiving an event which is equal to an event attribute setting in the behavior element, and calling a script associated with the behavior element.

BRIEF DESCRIPTIONS OF THE DRAWINGS

[0027] FIG. 1 shows a typical web display environment for displaying web pages and web applications.

[0028] FIG. 2 shows an example of a scalable vector graphics interactivity extension system, in accordance with an embodiment of the present invention.

[0029] FIG. 3 shows another example of a scalable vector graphics interactivity extension system, in accordance with the scalable vector graphics interactivity extension system.

[0030] FIG. 4 is a flowchart of an example of a method of manipulating a document object model of a web application at load time, in accordance with the scalable vector graphics interactivity extension system.

[0031] FIG. 5 is a flowchart of a method of a method manipulating a document object model of a web application in response to an event, in accordance with the scalable vector graphics interactivity extension system.

[0032] FIG. 6 is a flowchart of another example of an method of manipulating a document object model of a web application, in accordance with the scalable vector graphics interactivity extension system.

[0033] FIG. 7

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0034] FIG. 1 shows a typical web display environment 10 for displaying web pages and web applications. A web display environment 10 comprises a browser 11 , a viewer 13 , a script interpreter 14 , and a DOM 15 . The browser 11 is the host application, which understands and visually renders hypertext markup language (HTML) and/or extensible hypertext markup language (XHTML). Examples of browsers include Netscape (™) and Internet Explorer (™). The browser 11 includes a window which is displayed on the display apparatus, such as a monitor, of an end user computer system. The browser 11 typically employs a plug-in architecture, in which third party software (known as the plug-in or viewer 13 ) can be associated with any file format that is not already natively supported by the browser 11 and is allowed to render that file within the host browser's 11 window. One type of file that the browser 11 may be asked to open is a Scalable Vector Graphic (SVG) file having a “.svg” extension. The browser 11 does not natively support the SVG markup language (which is an XML language) and so passes the SVG file to the SVG viewer 13 , which has associated itself to the SVG file format, via the rules of the plug-in architecture of the browser 11 .

[0035] The viewer 13 comprises software code for parsing the SVG markup, creating a DOM, rendering that DOM to the browser's window, listening for events and dispatching them to their assigned handler script functions, and interpreting/executing those script functions. An example of a viewer 13 is the Corel (™) SVG Viewer. The viewer 13 uses the SVG file received from the browser 11 to create a DOM 15 . The DOM is a hierarchical tree structure of objects in memory, representing the hierarchical XML markup in the XML text file. The DOM also contains methods (also known as functions or application programming interfaces (API's)) that allow it to be queried or modified. The viewer 13 may also have access to a script interpreter/engine 14 , which can execute script code created by a programmer for the purpose of making the document non-static (e.g., animation) and/or interactive with the user (e.g., the user can create events with the mouse or keyboard, which cause something to happen) via manipulation of the DOM.

[0036] The following common data types are used in this specification:

[0037] <boolean>: A <boolean> is specified as either ‘true’ or ‘false’.

[0038] <integer>: An <integer> is specified as an optional sign character (‘+’ or ‘−’) followed by one or more digits “0” to “9”. If the sign character is not present, the number is non-negative.

[0039] Unless stated otherwise for a particular attribute or property, the range for a <integer> encompasses (at a minimum) −2147483648 to 2147483647.

[0040] Within the SVG DOM, an <integer> is represented as an long or an SVGAnimatedInteger.

[0041] <number> (real number value): The specification of real number values is different for property values than for XML attribute values.

[0042] The Cascading Style Sheets, level 2 (CSS2) Specification—a style sheet language that allows one to attach style (e.g. fonts, spacing and aural cues) to structured documents (e.g. HTML documents and XML applications)—states that a property value which is a <number> is specified in decimal notation (i.e., a <decimal-number>), which consists of either an <integer>, or an optional sign character followed by zero or more digits followed by a dot (.) followed by one or more digits. Thus, for conformance with CSS2, any property in SVG which accepts <number> values is specified in decimal notation only.

[0043] For SVG's XML attributes, to provide as much scalability in numeric values as possible, real number values can be provided either in decimal notation or in scientific notation (i.e., a <scientific-number>), which consists of a <decimal-number> immediately followed by the letter “e” or “E” immediately followed by an <integer>.

[0044] Unless stated otherwise for a particular attribute or property, a <number> has the capacity for at least a single-precision floating point number (ICC32) and has a range (at a minimum) of −3.4e+38F to +3.4e+38F.

[0045] It is recommended that higher precision floating point storage and computation be performed on operations such as coordinate system transformations to provide the best possible precision and to prevent round-off errors.

[0046] Conforming High-Quality SVG Viewers are required to use at least double-precision floating point (ICC32) for intermediate calculations on certain numerical operations.

[0047] Within the SVG DOM, a <number> is represented as a float or an SVGAnimatedNumber.

[0048] <length>: A length is a distance measurement. The format of a <length> is a <number> optionally followed immediately by a unit identifier. (Note that the specification of a <number> is different for property values than for XML attribute values.)

[0049] If the <length> is expressed as a value without a unit identifier (e.g., 48), then the <length> represents a distance in the current user coordinate system.

[0050] If one of the unit identifiers is provided (e.g., 12 mm), then the <length> is processed according to the description in Units.

[0051] Percentage values (e.g., 10%) depend on the particular property or attribute to which the percentage value has been assigned. Two common cases are: (a) when a percentage value represents a percent of the viewport (refer to the section that discusses Units in general), and (b) when a percentage value represents a percent of the bounding box on a given object (refer to the section that describes Object bounding box units).

[0052] Within the SVG DOM, a <length> is represented as an SVGLength or an SVGAnimatedLength. 1

<coordinate>: A <coordinate> represents a <length> in the user coordinate system
that is the given distance from the origin of the user coordinate
system along the relevant axis (the x-axis for X coordinates, the
y-axis for Y coordinates).
Within the SVG DOM, a <coordinate> is represented as an SVGLength or an
SVGAnimatedLength since both values have the same syntax.
<uri> (Uniform Resource Identifiers [URI] references): A URI is the address
of a resource on the
Web. For the
specification of URI
references in SVG,
see URI references.

[0053] Within the SVG DOM, <uri> is represented as a DOMString or an SVGAnimatedString.

[0054] FIG. 2 shows a system 20 for extending the interactivity of presentation markup languages (e.g., scalable vector graphics (SVG), hypertext markup language (HTML)), in accordance with an embodiment of the present invention. The SVG interactivity extension system 20 comprises one or more designated elements 29 , and one or more associated instructions (script or code) 28 . Preferably, the one or more designated elements 29 map to the one or more associated instructions 28 on a one-to-one basis. The designated elements 29 comprise a namespace and attributes. The namespace of the designated elements may follow a predetermined naming convention. For example, a prefix may be added to the generic name of the designated element 29 . In one example of an embodiment of an SVG interactivity extension system 20 , the prefix “dsvg:” is added to the generic name of the designated element 29 . Among the attributes of the element are name & xmlns (identifying that the element belongs to the dsvg). Other components may be added to the system 20 , such as an initialization function having instructions for traversing each node in a DOM, searching for the designated elements 29 by searching for any element whose name is prefixed with the desired namespace (e.g., “dsvg:”), and calling the associated instructions 28 that is associated with each particular behavior element, whose name follows the predetermined naming convention.

[0055] FIG. 3 shows another example of an SVG interactivity extension system 30 . The SVG extension system 30 comprises a collection of designated items 39 and a collection of associated instructions (script or code) 38 . The collection of designated items 39 comprises one or more of the following: flow control elements 22 , coordinate mapping elements 23 , viewer behavior elements 24 , a focus element 25 , a constraint element 26 , and a set of passive attributes 27 . The collection of associated instructions 38 comprise flow control instructions 32 , coordinate mapping instructions 33 , viewer behavior instructions 34 , a focus instruction 35 , a constraint instruction 36 , and a set of passive attributes instruction 37 . Items 38 , 39 may be added or removed from the SVG interactivity extension system 30 . An initialization file may be added as a component to the system 30 having instructions for traversing each node in a document object model (DOM) and for searching and calling functions associated with elements having names following a predetermined naming convention. The associated instructions 39 could be matched with the designated elements 38 through the initialization function (or file). Alternatively, the associated instructions 39 and designated elements 38 could be coded natively in a viewer 13 .

[0056] Flow Control Elements 22

[0057] Flow control is desired for building web applications. With scripting, programmers have conditional evaluative expressions, such as “if” and “switch” statements, and looping.

[0058] A flow control element 22 is used to control statement flow of the web application. Flow control elements are used for conditional rendering of graphical elements or execution of behavior elements. Flow control elements 22 are inserted in a document object model (DOM) as parents of other DOM elements which are to be rendered or executed if the conditional flow statement of the parent flow control element is satisfied.

[0059] The attributes of a flow control element 22 may comprise one attribute having a complex expression representing the flow control statement. Preferably, multiple attributes are present, with each attribute representing one item in the expression representing the flow control statement. Having such a one-to-one mapping of multiple attributes to flow control statement items is advantageous for data mapping, where a web application designer desires to define variables from one data type into extensible markup language (XML). The associated instruction 32 performs actions associated with the flow control element 22 .

[0060] Flow control elements 22 include the ‘if’ element, the ‘switch’ element, the ‘case’ element, the ‘default’ element, and the ‘loop’ element.

[0061] The ‘if’ Element

[0062] The ‘if’ element defines a simple conditional statement which, if evaluated to true, results in its child behavior elements being executed. Commonly used in conjunction with dSVG expressions for referencing the real-time value of element attributes. 2

<!ENTITY % ifExt “” >
<!ELEMENT dsvg:if (%Behaviors;) >
<!ATTLIST dsvg:if
%stdBehaviorAttrs;
value1 %Text; #IMPLIED
op %Operator; #IMPLIED
value2 %Text; #IMPLIED >

[0063] Attribute Definitions:

[0064] value1=‘<string>’

[0065] The first of two values to be compared. 3

op = “(equal | notEqual | lessThan | greaterThan | lessThanOrEqual |
greaterThanOrEqual)”
The operation to use in comparing the two values.
value2 =‘<string>’
The second of two values to be compared.
Figure 4 shows a push button 101 with associated ‘if’ behaviors. The if element
executes or renders child elements based on a conditional if statement. (true/false). The
example is provided below:
<?xml version=“1.0” standalone=“no”?>
<!DOCTYPE svg SYSTEM “../SVGdSVG.dtd”>
<svg xmlns:dsvg=“http://www.corel.com/schemas/2002/dSVG11”
xmlns:xlink=“http://www.w3.org/1999/xlink” height=“410px” width=“744px”
onload=“init(evt)” viewBox=“0 0 744 410”>
<script type=“text/ecmascript” xlink:href=“dsvg11/dSVG.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/baseUI.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/constraint.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/button.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/if.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/setData.js”>
<!-- template -->
<rect height=“40” width=“744” y=“0” x=“0” fill=“#5f86B1” id=“title_rect”/>
<text y=“25” x=“20” font-weight=“bold” font-size=“18” fill=“white”
id=“text_1”>dSVG sample behavior: condition - if
</text>
<line y2=“350” x2=“744” y1=“350” x1=“0” stroke-width=“2” stroke=“#5f86B1”
fill=“#5f86B1” id=“bottom_line”/>
<text y=“365” x=“20” font-size=“12” id=“content”>Content of file:
dsvg:checkBox, dsvg:Button, dsvg:if, dsvg:setData
</text>
<text y=“380” x=“20” font-size=“12” id=“expected”>The dsvg:if element
executes or renders child elements based on a conditional if statement. (true/false)
</text>
<!-- adding behavior -->
<dsvg:checkBox xlink:href=“dsvg11/skinCheckBox_Default.svg#skinCheckBox
autoScale=“true” disabled=“false” selected=“false” height=“12” width=“12” y=“70”
x=“50” label=“CheckBox” id=“checkBox1”/>
<dsvg:button xlink:href=“dsvg11/skinButton_Windows.svg#skinButton”
autoScale=“true” disabled=“false” selected=“false” toggle=“false” height=“18”
width=“100” y=“100.5” x=“50.5” label=“Check State” id=“dsvgUniqueID_1”>
<dsvg:if value2=“true” op=“equal” value1=“%checkBox1@selected%”
id=“dsvgUniqueID_2”>
<dsvg:setData value=“Check box selected state is true.”
elementID=“label1” id=“dsvgUniqueID_3”/>
</dsvg:if>
<dsvg:if value2=“true” op=“notEqual” value1=“%checkBox1@selected%”
id=“dsvgUniqueID_4”>
<dsvg:setData value=“Check box selected state is false.”
elementID=“label1” id=“dsvgUniqueID_5”/>
</dsvg:if>
</dsvg:button>
<text y=“150” x=“50” fill=“#5f86B1” id=“label1”>Label
</text>
</svg>

[0066] The ‘switch’ element

[0067] The ‘switch’ element defines a conditional statement, comparing one value to other values defined in child ‘case’ elements. Commonly used in conjunction with dSVG expressions for referencing the real-time value of variables or element attributes. 4

<!ENTITY % switchExt “” >
<!ELEMENT dsvg:switch (%Behaviors;) >
<!ATTLIST dsvg:switch
%stdBehaviorAttrs;
variable %Text; #IMPLIED >
Attribute definitions:
variable = ‘<string>’

[0068] Specifies the value to compare against many others, which are defined in the child ‘case’ elements. Usually, ‘variable’ will be a dSVG expression.

[0069] FIG. 5 shows a comboBox 105 with an associated ‘switch’ behavior, resulting in one of four ‘setData’ behaviors being run. The switch element compares conditions of the child case element(s) along with the default element values. The example is provided below: 5

<?xml version=“1.0” standalone=“no”?>
<!DOCTYPE svg SYSTEM “../SVGdSVG.dtd”>
<svg xmlns:dsvg=“http://www.corel.com/schemas/2002/dSVG11”
xmlns:xlink=“http://www.w3.org/1999/xlink” height=“410px” width=“744px”
onload=“init(evt)” viewBox=“0 0 744 410”>
<script type=“text/ecmascript” xlink:href=“dsvg11/dSVG.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/baseUI.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/constraint.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/spinBox.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/textbox.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/button.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/switch.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/setData.js”/>
<!-- template -->
<rect height=“40” width=“744” y=“0” x=“0” fill=“#5f86B1” id=“title_rect”/>
<text y=“25” x=“20” font-weight=“bold” font-size=“18” fill=“white”
id=“text_1”>dSVG sample behavior: condition - switch
</text>
<line y2=“350” x2=“744” y1=“350” x1=“0” stroke-width=“2” stroke=“#5f86B1”
fill=“#5f86B1” id=“bottom_line”/>
<text y=“365” x=“20” font-size=“12” id=“content”>Content of file:
dsvg:spinBox; dsvg:switch, dsvg:case, dsvg:default
</text>
<text y=“380” x=“20” font-size=“12” id=“expected”>The dsvg:switch element
compares conditions of the child dsvg:case element(s) along with the dsvg:default
element values.
</text>
<!-- adding behavior -->
<text y=“150” x=“50” fill=“#5f86B1” id=“label”>Label
</text>
<dsvg:spinBox selected=“false”
xlink:href=“dsvg11/skinSpinBox_Composite.svg#skinSpinB ox” autoScale=“true”
disabled=“false” increment=“1” value=“1” max=“5” min=“0” height=“18” width=“118”
y=“70” x=“50” label=“Spin box” id=“spin”>
<dsvg:switch variable=“%spin@value%” id=“dsvgUniqueID_4”>
<dsvg:case value=“1” id=“dsvgUniqueID_5”>
<dsvg:setData value=“Value is 1, minimum”
elementID=“label” id=“dsvgUniqueID_7”/>
</dsvg:case>
<dsvg:case value=“2” id=“dsvgUniqueID_6”>
<dsvg:setData value=“Value is two” elementID=“label”
id=“dsvgUniqueID_8”/>
</dsvg:case>
<dsvg:case value=“3” id=“dsvgUniqueID_7”>
<dsvg:setData value=“Value is THREE!”
elementID=“label” id=“dsvgUniqueID_9”/>
</dsvg:case>
<dsvg:default id=“dsvgUniqueID_8”>
<dsvg:setData value=“value is other than one two three”
elementID=“label” id=“dsvgUniqueID_10”/>
</dsvg:default>
</dsvg:switch>
</dsvg:spinBox>
<text y=“70” x=“200” id=“text_a”>Switch: CASE for values 1,2,3
</text>
<text y=“90” x=“200” id=“text_b”>Switch: DEFAULT for other values
</text>
<text y=“110” x=“200” id=“text_c”>In all cases, the value will be reflected in the
Label.
</text>
</svg>

[0070] The ‘case’ Element

[0071] The ‘case’ element is a child of the ‘switch’ element, which defines the value to compare to the ‘switch’ element's ‘value’ attribute. If it evaluates to true, its child elements are executed. Commonly used in conjunction with dSVG expressions for referencing the real-time value of variables or element attributes. 6

<!ENTITY % caseExt “” >
<!ELEMENT dsvg:case (%Behaviors;) >
<!ATTLIST dsvg:case
%stdBehaviorAttrs;
value %Text; #IMPLIED >
Attribute definitions:
value = ‘<string>’

[0072] Specifies the value to compare against the ‘switch’ element's ‘value’ attribute. Usually, ‘value’ will be a dSVG expression.

[0073] The ‘default’ Element

[0074] The ‘default’ element is a child of the ‘switch’ element, whose child behaviors are executed whenever none of the ‘switch’ element's ‘case’ elements evaluate to true. Commonly used in conjunction with dSVG expressions for referencing the real-time value of variables or element attributes. 7

<!ENTITY % defaultExt “” >
<!ELEMENT dsvg:default (%Behaviors;) >
<!ATTLIST dsvg:default
%stdBehaviorAttrs; >

[0075] The ‘loop’ Element

[0076] The ‘loop’ element allows its child behaviors to be executed iteratively (like a ‘for’ statement in ECMAscript) and/or upon multiple targets (like a ‘for-each’ statement in ECMAScript). A node list of multiple targets can be obtained from the ‘findElements’ element, which allows you to find all elements which match the specified search criteria. Optionally, the actual matching elements can be copied to a documentFragment, which can be used by the ‘postURL’ element. 8

<!ENTITY % loopExt “” >
<!ELEMENT dsvg:loop ANY >
<!ATTLIST dsvg:loop
%stdBehaviorAttrs;
elementIDs %Text;#IMPLIED
nodeList %Text;#IMPLIED
elementID ID; #IMPLIED
from %Integer; #IMPLIED
to %Integer; #IMPLIED
increment %Integer; #IMPLIED
value %Integer; #IMPLIED >

[0077] Attribute Definitions: 9

elementIDs = ‘<string>’
The search string to compare against the ‘id’ attribute of every element in the
DOM (or as a child of a specified parent element). It can contain the wildcard “*”
character to denote “any string”. Whenever an element is found whose ID matches
this search string, the child behaviors will be executed. For example,
elementIDs=“myCircle*” would match elements with the ID's “myCircle1” and
“myCircleRed”, whereas elementIDs=“*Circle*” would match elements with the
ID's “myCircle1” and “hisCircle2”.
nodeList = ‘<string>’
The identifier for the nodelist created by the ‘findElements’ behavior. All the child
behaviors will be run for each node in the nodeList.
elementID = “name”
The ‘id’ attribute of the current node. Each iteration, the ‘elementID’ attribute is
updated to correspond to the ‘id’ attribute of the current node. The child behaviors
can then reference that current node via the dSVG expression syntax.
This attribute should never be provided by the markup. It is automatically
populated for reference purposes.
from = “<integer>”
The first value to loop on.
from = “<integer>”

[0078] The last value to loop on. 10

interval = “<integer>”
The amount to increment with each itertion.
If this attribute is not provided, the default is 1.
value = “<integer>”
The value of the current iteration, between ‘from’ and ‘to’. Each
iteration, the ‘value’ attribute is updated. The child behaviors can
then reference that value via the dSVG expression syntax.

[0079] This attribute should never be provided by the markup. It is automatically populated for reference purposes.

[0080] FIG. 6 shows a push button 110 that invokes the ‘loop’ behavior, storing the matches in a nodelist, and using the ‘loop’ element to display the ID's of the nodes via the ‘alert’ element. The loop element is a sequence of instructions that is continually repeated until a certain condition is reached. The example is provided below: 11

<?xml version=“1.0” standalone=“no”?>
<!DOCTYPE svg SYSTEM “../SVGdSVG.dtd”>
<svg xmlns:dsvg=“http://www.corel.com/schemas/2002/dSVG11”
xmlns:xlink=“http:/www.w3.org/1999/xlink” height=“410px” width=“744px”
onload=“init(evt)” viewBox=“0 0:744 410”>
<script type=“text/ecmascript” xlink:href=“dsvg11/dSVG.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/baseUI.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/constraint.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/loop.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/button.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/setAttribute.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/setData.js”/>
<!-- template -->
<rect height=“40” width=“744” y=“0” x=“0” fill=“#5f86B1” id=“title_rect”/>
<text y=“25” x=“20” font-weight=“bold” font-size=“18” fill=“white”
id=“text_1”>dSVG sample behavior: loop
</text>
<text y=“365” x=“20” font-size=“12” id=“content”>Content of file: dsvg:loop,
dsvg:button, dsvg:setData, dsvg:setAttribute
</text>
<text y=“380” x=“20” font-size=“12” id=“expected”>The dsvg:loop element is a
sequence of instructions that is continually repeated until a certain condition is reached.
</text>
<text y=“395” x=“20” font-size=“12” id=“depend”/>
<line y2=“340” x2=“744” y1=“340” x1=“0” stroke-width=“2” stroke=“#5f86B1”
fill=“#5f86B1” id=“bottom_line”/>
<!-- adding behavior -->
<g id=“sizer”>
<rect height=“8” width=“8” y=“100” x=“25” fill=“gray” id=“sizer1”/>
<rect height=“8” width=“8” y=“100” x=“35” fill=“gray” id=“sizer2”/>
<rect height=“8” width=“8” y=“100” x=“45” fill=“gray” id=“sizer3”/>
<rect height=“8” width=“8” y=“100” x=“55” fill=“gray” id=“sizer4”/>
<rect height=“8” width=“8” y=“100” x=“65” fill=“gray” id=“sizer5”/>
<rect height=“8” width=“8” y=“100” x=“75” fill=“gray” id=“sizer6”/>
<rect height=“8” width=“8” y=“100” x=“85” fill=“gray” id=“sizer7”/>
<rect height=“8” width=“8” y=“100” x=“95” fill=“gray” id=“sizer8”/>
<rect height=“8” width=“8” y=“100” x=“105” fill=“gray” id=“sizer9”/>
<rect height=“8” width=“8” y=“100” x=“115” fill=“gray” id=“sizer10”/>
<rect height=“8” width=“8” y=“100” x=“125” fill=“gray” id=“sizer11”/>
<rect height=“8” width=“8” y=“100” x=“135” fill=“gray” id=“sizer12”/>
<rect height=“8” width=“8” y=“100” x=“145” fill=“gray” id=“sizer 13”/>
<rect height=“8” width=“8” y=“100” x=“155” fill=“gray” id=“sizer14”/>
<rect height=“8” width=“8” y=“100” x=“165” fill=“gray” id=“sizer15”/>
<rect height=“8” width=“8” y=“100” x=“175” fill=“gray” id=“sizer16”/>
<rect height=“8” width=“8” y=“100” x=“185” fill=“gray” id=“sizer17”/>
<rect height=“8” width=“8” y=“100” x=“195” fill=“gray” id=“sizer18”/>
</g>
<dsvg:button xlink:href=“dsvg11/skinButton_Windows.svg#skinButton”
autoScale=“true” disabled=“false” selected=“false” toggle=“false” height=“18”
width=“100” y=“70” x=“220” label=“Loop Count” id=“loop1”>
<dsvg:loop increment=“1” to=“18” from=“1” id=“LOOP1”>
<dsvg:setAttribute value=“%LOOP1@value * 10%”
attribute=“height” elementID=“sizer%LOOP1@value%”/>
</dsvg:loop>
<dsvg:setData value=“%LOOP1@value%” elementID=“iteration”
id=“data”/>
</dsvg:button>
<text y=“70” x=“25” fill=“#5f86B1” color=“” id=“desc”># of times through the
loop:
</text>
<text y=“70” x=“180” font-weight=“bold” font-size=“14” fill=“darkblue”
id=“iteration”>0
</text>
</svg>

[0081] The ‘timer’ Element

[0082] The ‘timer’ element allows its child behaviors to be executed iteratively at a specified time interval until such time as its ‘break’ attribute evaluates to true. The ‘iteration’ attribute is incremented internally so that it can be referenced by the child behaviors for context. 12

<!ENTITY % timerExt “” >
<!ELEMENT dsvg:timer ANY >
<!ATTLIST dsvg:timer
%stdBehaviorAttrs;
interval %Number; #IMPLIED
break %Boolean; #IMPLIED
iteration %Integer; #IMPLIED >

[0083] Attribute Definitions:

[0084] interval=‘<number>’

[0085] The time, in milliseconds, between each iteration.

[0086] break=‘“(true|false)”’

[0087] A value of ‘true’ causes the timer to stop running. A value of ‘false’ causes the timer to continue running. The default is ‘false’. It is expected that either the ‘break’ attribute gets modified externally via the setAttribute behavior, or it is a dSVG expression, which gets re-evaluated every iteration.

[0088] iteration=“<number>”

[0089] The value of the current iteration, where the first iteration starts at zero, i.e. the number of times the child behaviors have been run. Each iteration, the child behaviors can reference this ‘iteration’ attribute via the dSVG expression syntax. This attribute should never be provided by the markup. It is automatically populated for reference purposes.

[0090] FIG. 7 shows shows a set of rectangles with 2 timers applied—one that starts at the first rectangle, setting each consecutive rectangle green, and another starting at the last rectangle, setting each previous rectangle blue. The example is provided below: 13

<?xml version=“1.0” encoding=“UTF-8” standalone=“no”?>
<!DOCTYPE svg SYSTEM “../SVGdSVG.dtd”>
<svg xmlns:dsvg=“http://www.corel.com/schemas/2002/dSVG20”
xmlns:xlink=“http://www.w3.org/1999/xlink” height=“410px” width=“744px”
onload=“init(evt)” viewBox=“0 0 744 410”>
<script type=“text/ecmascript” xlink:href=“dSVG20/dSVG.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/baseUI.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/constraint.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/button.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/setAttribute.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/timer.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/if.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/alert.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/setData.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/loadXML.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/slider.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/removeElement.js”/>
<script type=“text/ecmascript” xlink:href=“dSVG20/zoom.js”/><!-- template -->
<defs/>
<g id=“template”>
<rect height=“40” width=“744” y=“0” x=“0” fill=“#5f86B1”
id=“title_rect”/>
<text y=“25” x=“20” font-weight=“bold” font-size=“18” fill=“white”
id=“text_1”>dSVG sample behavior: timer
</text>
<text y=“365” x=“20” font-size=“12” id=“content”>Selecting the button in
the top portion will set the cx attribute for the circle.
</text>
<text y=“380” x=“20” font-size=“12” id=“expected”>The bottom set of
rects has 2 timer applied.
</text>
<text y=“395” x=“20” font-size=“12” id=“depend”>1 moving forward to
set each consecutive rect green. 1 starting at the last rect moving backwards turning each
rect blue.
</text>
<line y2=“340” x2=“744” y1=“340” x1=“0” stroke-width=“2”
stroke=“#5f86B1” fill=“#5f86B1” id=“bottom_line”/>
<line y2=“180” x2=“744” y1=“180” x1=“0” stroke-width=“2”
stroke=“#5f86B1” fill=“#5f86B1” id=“mid_line”/>
</g>
<g id=“basicGroup”>
<circle r=“10” cy=“120” cx=“60” id=“circle1”/>
<text y=“70” x=“227” visibility=“hidden” id=“text_distance”>200
</text>
<dsvg:button xlink:href=“dSVG20/skinButton_Windows.svg#skinButton”
autoScale=“true” height=“18” width=“100” y=“80” x=“50” label=“basic”
id=“button_basic”>
<dsvg:variable value=“%circle1@cx + 2.5%” name=“var_basic”
id=“var_basic”/>
<dsvg:setAttribute value=“#5f86B1” attribute=“fill”
elementID=“circle1” id=“dsvgUniqueID_1”/>
<dsvg:timer break=“%timer_basic@iteration > 50%” interval=“20”
event=“onclick” id=“timer_basic”>
<dsvg:setAttribute value=“%$var_basic%” attribute=“cx”
elementID=“circle1” id=“dsvgUniqueID_3”/>
<dsvg:if value2=“a” op=“equal” value1=“a”
id=“dsvgUniqueID_5”>
<dsvg:setAttribute value=“visible”
attribute=“visibility” elementID=“text_distance” id=“dsvgUniqueID_7”/>
<dsvg:setData value=“The cx position of the circle
is: %circle1@cx%” elementID=“text_distance” id=“dsvgUniqueID_8”/>
</dsvg:if>
</dsvg:timer>
</dsvg:button>
</g>
<g id=“rectTimers”>
<g id=“crossingTimers”>
<dsvg:timer break=“%timer3@iteration > 4999%” interval=“357”
event=“onload” id=“timer3”>
<dsvg:variable
value=“%substring(timer3@iteration,length(timer3@itera tion),(length(timer3@iteration)-
1))%” name=“valTwo” id=“v4”/>
<dsvg:setAttribute value=“Green” attribute=“fill”
elementID=“myRect%$valTwo%”/>
<dsvg:setAttribute value=“0.4” attribute=“opacity”
elementID=“myRect%$valTwo%”/>
<dsvg:setAttribute value=“blue” attribute=“fill”
elementID=“myRect%10 - $valTwo%”/>
<dsvg:setAttribute value=“.4” attribute=“opacity”
elementID=“myRect%10 - $valTwo%”/>
</dsvg:timer>
</g>
<g id=“rectGroup”>
<rect height=“30” width=“30” y=“200” x=“50” fill=“black”
id=“myRect1”/>
<rect height=“30” width=“30” y=“200” x=“90” fill=“black”
id=“myRect2”/>
<rect height=“30” width=“30” y=“200” x=“130” fill=“black”
id=“myRect3”/>
<rect height=“30” width=“30” y=“240” x=“50” fill=“black”
id=“myRect4”/>
<rect height=“30” width=“30” y=“240” x=“90” fill=“black”
id=“myRect5”/>
<rect height=“30” width=“30” y=“240” x=“130” fill=“black”
id=“myRect6”/>
<rect height=“30” width=“30” y=“280” x=“50” fill=“black”
id=“myRect7”/>
<rect height=“30” width=“30” y=“280” x=“90” fill=“black”
id=“myRect8”/>
<rect height=“30” width=“30” y=“280” x=“130” fill=“black”
id=“myRect9”/>
</g>
</g>
<g id=“insertGroup”/>
</svg>

[0091] Coordinate Mapping Elements 23

[0092] Often a web application requires the ability to click and drag objects, perhaps for the purposes of editing their positions. SVG does not currently have this capability. Thus, script is required which tracks the mouse movements and creates a translation transform on the object. Also, a user may desire to display coordinate information for where the mouse curser is located. Thus, the user first needs to know where the mouse cursor is in the coordinate system of the SVG document, before the user can convert the coordinate information to the coordinate system the user is using. Currently, only script can assist a user.

[0093] In order to display coordinate-based data, such as the location of cities on a background map, a user must convert those coordinates to the coordinate system of the SVG document. An example of such a conversion is a linear transformation (a scale and translation), such as a cartesian grid with parallel latitude and longitude lines. Another example of a transformation is a polynomial transformation, such as for a map with a latitude/longitude projection (i.e., curved lines of latitude, angled lines of longitude). Usually, calculations are required to determine transformations. SVG does not provide markup for creating and applying complex mathematical transformations.

[0094] Sometimes data visualized in a web application uses a projection system, such as a latitude/longitude or universal transverse mercator (UTM), which usually requires knowledge of how the projection system operates. To be able to map to the coordinate system of an SVG document usually requires knowledge of how to convert between such projections. SVG does not provide markup to specify a projection system and parameters, and automatically map any coordinate from one system to the other.

[0095] A coordinate mapping element 23 manipulates the coordinates of an object in the web application. Coordinate mapping elements 23 are used to display an object whose coordinates are in a system different from the DOM coordinate system. A coordinate mapping element 23 is inserted in a DOM as a child of another DOM elements.

[0096] The attributes of a coordinate mapping element 23 include point pair coordinates. The associate instruction 33 performs actions used to take third party XML data and position the data in a DOM. Coordinate mapping elements 23 include the ‘mousePosition’ element, the ‘mapCoords’ element, the ‘pointPair’ element, and the ‘mapProj’ element.

[0097] The ‘mousePosition’ Element

[0098] The ‘mousePosition’ element defines a container for holding the current mouse coordinates, relative to the document or to the target element. It is a persistent object in memory that should be instantiated once, and so should not be a child of any element other than the ‘svg’ root element (or a ‘g’ element). 14

<!ENTITY % mousePositionExt “” >
<!ELEMENT dsvg:mousePosition EMPTY >
<!ATTLIST dsvg:mousePosition
%stdBehaviorAttrs;
elementID ID #IMPLIED
x %Coordinate; #IMPLIED
y %Coordinate; #IMPLIED
type %Type“relative” >

[0099] Attribute Definitions:

[0100] elementID=“name”

[0101] The ‘id’ attribute of the target element to generate the mouse events.

[0102] x=“<coordinate>”

[0103] The current x-coordinate of the mouse cursor. Setting this attribute has no effect—it is purely a storage attribute, intended to be referenced.

[0104] y=“<coordinate>”

[0105] The current y-coordinate of the mouse cursor. Setting this attribute has no effect—it is purely a storage attribute, intended to be referenced.

[0106] type=“(relative|absolute)”

[0107] Specifies whether the mouse coordinates are to be relative to the document (absolute) or relative to the target element (relative).

[0108] FIG. 8 shows a rectangle 115 with mouse coordinates displayed relative to both the document and the rectangle. The mousePosition element defines a container for holding the current mouse coordinates. The coordinates can be tracked relative to the document or absolute to the parent element. The example is provided below: 15

<?xml version=“1.0” standalone=“no”?>
<!DOCTYPE svg SYSTEM “../SVGdSVG.dtd”>
<svg xmlns:dsvg=“http://www.corel.com/schemas/2002/dSVG11”
xmlns:xlink=“http://www.w3.org/1999/xlink” height=“410px” width=“744px”
onload=“init(evt)” viewBox=“0 0 744 410”>
<script type=“text/ecmascript” xlink:href=“dsvg11/dSVG.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/baseUI.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/constraint.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/mousePosition.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/setData.js”/>
<!-- template -->
<rect height=“40” width=“744” y=“0” x=“0” fill=“#5f86B1” id=“title_rect”/>
<text y=“25” x=“20” font-weight=“bold” font-size=“18” fill=“white”
id=“text_1”>dSVG sample behavior: mousePosition
</text>
<text y=“365” x=“20” font-size=“12” id=“content”>Content of file:
dsvg:mousePosition, dsvg:setData
</text>
<text y=“380” x=“20” font-size=“12” id=“expected”>The dsvg:mousePosition
element defines a container for holding the current mouse coordinates.
</text>
<text y=“395” x=“20” font-size=“12” id=“depend”>The coordinates can be
tracked relative to the document or absolute to the parent element.
</text>
<line y2=“340” x2=“744” y1=“340” x1=“0” stroke-width=“2” stroke=“#5f86B1”
fill=“#5f86B1” id=“bottom_line”/>
<!-- adding behavior -->
<text y=“60” x=“50” id=“targetText”>Target Rectangle
</text>
<rect height=“200” width=“200” y=“70” x=“50” stroke-width=“3” stroke=“black”
fill=“#5f86B1” id=“rect1”>
<dsvg:setData value=“%mouse_Relative@x%”
elementID=“relative_xpos” event=“onmousemove” id=“set_relativeX”/>
<dsvg:setData value=“%mouse_Relative@y%”
elementID=“relative_ypos” event=“onmousemove” id=“set_relativeY”/>
<dsvg:setData value=“%mouse_Absolute@x%”
elementID=“absolute_xpos” event=“onmousemove” id=“set_absoluteX”/>
<dsvg:setData value=“%mouse_Absolute@y%”
elementID=“absolute_ypos” event=“onmousemove” id=“dsvgUniqueID_5”/>
</rect>
<dsvg:mousePosition type=“relative” elementID=“rect1” event=“onmousemove”
id=“mouse_Relative”/>
<dsvg:mousePosition type=“absolute” elementID=“rect1” event=“onmousemove”
id=“mouse_Absolute”/>
<text y=“290” x=“40” id=“textx_relative”>Relative Position
</text>
<text y=“310” x=“40” id=“relative_xlabel”>X=
</text>
<text y=“330” x=“40” id=“relative_ylabel”>Y=
</text>
<text y=“310” x=“60” font-size=“8” fill=“green” id=“relative_xpos”>x Position
</text>
<text y=“330” x=“60” font-size=“8” fill=“green” id=“relative_ypos”>y Position
</text>
<text y=“290” x=“190” id=“textx_absolute”>Absolute Position
</text>
<text y=“310” x=“190” id=“absolute_xlabel”>X=
</text>
<text y=“330” x=“190” id=“absolute_ylabel”>Y=
</text>
<text y=“310” x=“210” font-size=“8” fill=“green” id=“absolute_xpos”>x Position
</text>
<text y=“330” x=“210” font-size=“8” fill=“green” id=“absolute_ypos”>y Position
</text>
</svg>

[0109] The ‘mapCoords’ Element

[0110] The ‘mapCoords’ element defines an object used for mapping coordinates in one space to another space, via a polynomial transformation, whose coefficients are determined by the coordinates of the point-pairs given in the child ‘pointPair’ elements. 16

<!ENTITY % mapCoordsExt “” >
<!ELEMENT dsvg:mapCoords (dsvg:pointPair)* >
<!ATTLIST dsvg:mapCoords
%stdBehaviorAttrs;
order %Integer; #IMPLIED
inputID ID #IMPLIED
x %Coordinate; #IMPLIED
y %Coordinate; #IMPLIED
u %Coordinate; #IMPLIED
v %Coordinate; #IMPLIED
apply %Boolean “false” >

[0111] Attribute Definitions: 17

order = “<integer>”
The order of the polynomial transformation. The default is 1, which only requires
2 point-pairs, resulting in an affine (linear) transformation.
inputID = “name”
The ‘id’ attribute of the element that will automatically feed its coordinates into the
‘mapCoords’ element's ‘x’ and ‘y’ attributes whenever they update. e.g. the ID of a
‘mousePosition’ element.
x = “<coordinate>”
The x-coordinate of the first coordinate system. Updating this attribute
automatically updates the ‘u’ attribute.
y = “<coordinate>”
The y-coordinate of the first coordinate system. Updating this attribute
automatically updates the ‘v’ attribute.
u = “<coordinate>”
The x-coordinate of the second coordinate system. Updating this attribute
automatically updates the ‘x’ attribute.
v = “<coordinate>”
The y-coordinate of the second coordinate system. Updating this attribute
automatically updates the ‘y’ attribute.
apply = “(true | false)”
Specifies whethr the coordinates of the element defined by ‘inputID’will be
actually modified according to the polynomial transformation defined by the
point-pairs (true) or not (false).

[0112] FIG. 9 shows two ellipses 120 and 125 transformed to another coordinate space. The mapCoords element defines an object used for mapping from one coordinate space to another. The resulting coefficients are determined by the coordinates of the point-pairs (child) elements. The example is provided below: 18

<?xml version=“1.0” standalone=“no”?>
<!DOCTYPE svg SYSTEM “../SVGdSVG.dtd”>
<svg xmlns:dsvg=“http://www.corel.com/schemas/2002/dSVG11”
xmlns:xlink=“http://www.w3.org/1999/xlink” height=“410px” width=“744px”
onload=“init(evt)” viewBox=“0 0 744 410”>
<script type=“text/ecmascript” xlink:href=“dsvg11/dSVG.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/baseUI.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/constraint.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/mapCoords.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/setAttribute.js”/>
<!-- template -->
<rect height=“40” width=“744” y=“0” x=“0” fill=“#5f86B1” id=“title_rect”/>
<text y=“25” x=“20” font-weight=“bold” font-size=“18” fill=“white”
id=“text_1”>dSVG sample behavior: mapCoords
</text>
<text y=“365” x=“20” font-size=“12” id=“content”>Content of file:
dsvg:mapCoords, dsvg:pointPair, dsvg:setAttribute
</text>
<text y=“380” x=“20” font-size=“12” id=“expected”>The dsvg:mapCoords
element defines an object used for mapping from one coordinate space to another.
</text>
<text y=“395” x=“20” font-size=“12” id=“depend”>The resulting coefficients are
determined by the coordinates of the point-pairs (child) elements.
</text>
<line y2=“340” x2=“744” y1=“340” x1=“0” stroke-width=“2” stroke=“#5f86B1”
fill=“#5f86B1” id=“bottom_line”/>
<!-- adding behavior -->
<g id=“fragment”>
<ellipse ry=“50” rx=“100” cy=“115” cx=“175” fill=“orange”
id=“fragellipse1”/>
<ellipse ry=“25” rx=“50” cy=“115” cx=“175” fill=“blue”
id=“fragellipse2”/>
</g>
<rect height=“100” width=“200” y=“65” x=“75” stroke-width=“1” stroke=“red”
fill=“none”/>
<text y=“185” x=“75” font-size=“10” fill=“red”>Incorrect Location
</text>
<rect height=“100” width=“200” y=“165” x=“175” stroke-width=“1”
stroke=“green” fill=“none”/>
<text y=“285” x=“175” font-size=“10” fill=“green”>correct Location
</text>
<dsvg:mapCoords apply=“true” inputID=“fragment” id=“mapcoords1”>
<dsvg:pointPair v=“100” u=“100” y=“0” x=“0”/>
<dsvg:pointPair v=“110” u=“110” y=“10” x=“10”/>
</dsvg:mapCoords>
<dsvg:setAttribute value=“true” attribute=“convertNow”
elementID=“mapcoords1” id=“dsvgUniqueID_3”/>
</svg>

[0113] The ‘pointPair’ Element

[0114] The ‘pointPair’ element, which must be a child of the ‘mapCoords’ element, defines the x-y coordinates for the same location in two different coordinate spaces. The point-pairs are used to calculate the polynomial transformation coefficients. 19

<!ENTITY % pointPairExt “” >
<!ELEMENT dsvg:pointPair EMPTY >
<!ATTLIST dsvg:pointPair
%stdBehaviorAttrs;
x %Coordinate; #IMPLIED
y %Coordinate; #IMPLIED
u %Coordinate; #IMPLIED
v %Coordinate; #IMPLIED >

[0115] Attribute Definitions: 20

x = “<coordinate>”
The x-coordinate of the first coordinate system.
y = “<coordinate>”
The y-coordinate of the first coordinate system.
u = “<coordinate>”
The x-coordinate of the second coordinate system.
v = “<coordinate>”
The y-coordinate of the second coordinate system.

[0116] The ‘mapProj’ Element

[0117] The ‘mapProj’ element defines an object used for mapping coordinates in one space to another space, via a polynomial transformation, whose coefficients are determined by the coordinates of the point-pairs given in the child ‘pointpair’ elements. 21

<!ENTITY % mapProjExt “” >
<!ELEMENT dsvg:mapProj EMPTY >
<!ATTLIST dsvg:mapProj
%stdBehaviorAttrs;
inputID ID #IMPLIED
inputProj %Projection “UTM”
outputProj %Projection “LatLong”
ellipsoid %Ellipsoid “WGS84”
zone %Text #IMPLIED
x %Coordinate; #IMPLIED
y %Coordinate; #IMPLIED
u %Coordinate; #IMPLIED
v %Coordinate; #IMPLIED >

[0118] Attribute Definitions: 22

inputID = “name”
The ‘id’ attribute of the element that will automatically feed its coordinates into the
‘mapProj’ element's ‘x’ and ‘y’ attributes whenever they update. e.g. the ID of a
‘mapCoords’ element.
inputProj = “(UTM | LatLong)”
The input project system.
If this attribute is not provided, the default is “UTM”.
outputProj = “(UTM | LatLong)”
The output project system.
If this attribute is not provided, the default is “LatLong”.
ellipsoid = “(Airy | AustralianNational | Bessel1841 | Bessel1841Nambia | Clarke1866 |
Clarke1880 | Everest | Fischer1960Mercury | Fischer1968 | GRS1967 | GRS1980 |
Helmert1906 | Hough | International | Krassovsky | ModifiedAiry | ModifiedEverest |
ModifiedFischer1960 | SouthAmerican1969 | WGS60 | WGS66 | WGS72 | WGS84)”
The ellipsoid of the UTM projection system.
If this attribute is not provided, the default is “WGS84”.
zone = ‘<string>’
The zone of the UTM projection system.
x = “<coordinate>”
The x-coordinate of the first projection system. Updating this attribute
automatically updates the ‘u’ attribute.
y = “<coordinate>”
The y-coordinate of the first projection system. Updating this attribute
automatically updates the ‘v’ attribute.
u = “<coordinate>”
The x-coordinate of the second projection system. Updating this attribute
automatically updates the ‘x’ attribute.
v = “<coordinate>”
The y-coordinate of the second projection system. Updating this attribute
automatically updates the ‘y’ attribute.

[0119] FIG. 10 shows two ellipses transformed to another coordinate space. The mapProj element defines an object used for mapping coordinates from one project system to another. For example, “latlong” can be mapped to “UTM”. The example is provided below: 23

<?xml version=“1.0” standalone=“no”?>
<!DOCTYPE svg SYSTEM “../SVGdSVG.dtd”>
<svg xmlns:dsvg=“http://www.corel.com/schemas/2002/dSVG11”
xmlns:xlink=“http://www.w3.org/1999/xlink” height=“410px” width=“744px”
onload=“init(evt)” viewBox=“0 0 744 410”>
<script type=“text/ecmascript” xlink:href=“dsvg11/dSVG.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/baseUI.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/constraint.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/mousePosition.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/mapCoords.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/setData.js”/>
<script type=“text/ecmascript” xlink:href=“dsvg11/mapProj.js”/>
<!-- template -->
<rect height=“40” width=“744” y=“0” x=“0” fill=“#5f86B1” id=“title_rect”/>
<text y=“25” x=“20” font-weight=“bold” font-size=“18” fill=“white”
id=“text_1”>dSVG sample behavior: mapProj
</text>
<text y=“365” x=“20” font-size=“12” id=“content”>Content of file: dsvg:mapProj,
dsvg:mapCoords, dsvg:pointPair, dsvg:setData, dsvg:mousePosition
</text>
<text y=“380” x=“20” font-size=“12” id=“expected”>The dsvg:mapProj element
defines an object used for mapping coordinates from one project system to another.
</text>
<text y=“395” x=“20” font-size=“12” id=“depend”>For example, “latlong” can be
mapped to “UTM”.
</text>
<line y2=“340” x2=“744” y1=“340” x1=“0” stroke-width=“2” stroke=“#5f86B1”
fill=“#5f86B1” id=“bottom_line”/>
<!-- adding behavior -->
<text y=“65” x=“10” font-weight=“bold” id=“targetText”>Target Image
</text>
<image height=“371” width=“325” y=“0” x=“50” transform=“ translate(50 50)
scale(0.75)” xlink:href=“314_canutillo.jpg” id=“canutillo”>
<dsvg:setData value=“%mousePosition@x%, %mousePosition@y%”
elementID=“textMousePosition” event=“onmousemove”/>
<dsvg:setData value=“%pixelsToUTM@u%, %pixelsToUTM@v%”
elementID=“textUTM” event=“onmousemove”/>
<dsvg:setData value=“%UTMToLatLong@latitude%
%UTMToLatLong@longitude%” elementID=“textLL” event=“onmousemove”/>
</image>
<dsvg:mousePosition type=“relative” elementID=“canutillo”
event=“onmousemove” id=“mousePosition”/>
<dsvg:mapCoords inputID=“mousePosition” id=“pixelsToUTM”>
<dsvg:pointPair v=“3534270” u=“346020” y=“0” x=“0”/>
<dsvg:pointPair v=“3541920” u=“352710” y=“371” x=“325”/>
</dsvg:mapCoords>
<dsvg:mapProj zone=“13” ellipsoid=“WGS84” outputProj=“LatLong”
inputProj=“UTM” inputID=“pixelsToUTM” id=“UTMToLatLong”/>
<text y=“285” x=“360”
style=“font-weight:normal;font-size:11;font-family:Tah oma;fill:#000000”>x,y:
</text>
<text y=“305” x=“360”
style=“font-weight:normal;font-size:11;font-family:Tah oma;fill:#000000”>UTM:
</text>
<text y=“325” x=“360”
style=“font-weight:normal;font-size:11;font-family:Tah oma;fill:#000000”>Lat/Long:
</text>
<text y=“285” x=“420”
style=“font-weight:normal;font-size:11;font-family:Tah oma;fill:#000000;”
id=“textMousePosition”>
</text>
<text y=“305” x=“420”
style=“font-weight:normal;font-size:11;font-family:Tah oma;fill:#000000;”
id=“textUTM”>
</text>
<text y=“325” x=“420”
style=“font-weight:normal;font-size:11;font-family:Tah oma;fill:#000000;” id=“textLL”>
</text>
</svg>

[0120] Viewer Behavior Elements 24

[0121] SVG viewers allow a user to zoom in and out, and to pan, using a built-in UI, or by accessing the SVG DOM via script. There currently does not exists an SVG DOM API for playing a sound. One way to play a sound currently is via an Adobe (™) extension in the Adobe SVG Viewer.

[0122] A viewer behavior element 24 is used to manipulate viewer behavior with respect to the web application. An example of a viewer is an SVG pluggin for a web browser. In particular, the viewer behavior elements 24 assist a designer to zoom and pan the current document or a document fragment.

[0123] The attributes of a viewer behavior element 24 include an event attribute that triggers the viewer behavior element. The associated instruction 34 performs actions used to zoom and pan a document in a web application. Other actions may be performed by the associated implementation code 34 .

[0124] Some behavior elements have attributes that provide the ID of other elements. For instance, <dsvg:setAttribute> uses an ‘elementID’ attribute to specify the target element whose attribute is to be modified. In such cases, the method of targeting other elements could be more robust. One example would be to have additional attributes that allow for the targeting of different frames, objects and documents in an HTML page, which would allow for behaviors in multiple SVG documents embedded in a single HTML document to interact with each other. Another example would be to use XPath expressions (http://www.w3.org/TR/xpath) rather than ID's to target elements. Using XPaths could also enable some behaviors to act upon multiple targets.

[0125] Viewer behavior elements 24 include the ‘alert’ element, the ‘function’ element, the ‘loadURL’ element, the ‘pan’ element, the ‘postURL’ element, the ‘zoom’ element, and the ‘playSound’ element. Examples of the viewer behavior elements 24 are provided below. The examples provide a syntax, a description and attributes of the viewer behavior elements 24 . Other viewer behavior element 24 may be created. The provided viewer behavior elements 24 are examples of one implementation. The common attributes and viewer behavior elements 24 are presented as fragments of a sample document type definition (DTD).

[0126] Common Attributes 24

<!ENTITY % stdBehaviorAttrs”