[0001] The invention relates to web application development. In particular, the invention relates to a system and method for extending scalable vector graphics capabilities.
[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:
[0014] given 3 or more coordinate pairs {x
[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.
[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.
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035] The viewer
[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.
<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]
[0055]
[0056] Flow Control Elements
[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
[0059] The attributes of a flow control element
[0060] Flow control elements
[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.
<!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.
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.
<!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]
<?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.
<!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.
<!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.
<!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:
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.
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]
<?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.
<!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]
<?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
[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
[0096] The attributes of a coordinate mapping 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).
<!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]
<?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.
<!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:
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]
<?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.
<!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:
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.
<!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:
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]
<?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
[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
[0123] The attributes of a viewer behavior element
[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
[0126] Common Attributes
<!ENTITY % stdBehaviorAttrs”