473,396 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

scripting nested svg documents

I'm a greenhorn in SVG and javascripting but I'm learning by doing.
So, here my current problem question :

I have a svg document embedded in another svg document. I whant,
through functions in an external javascript file, manipulate objects
in either the child svg document or the parent document.
How do I get access to elements of the other document ?

Example : I have a document "A" containing X/Y - Axis and included
another svg document "B" with the graphs.

I whant now, as soon as the mouse cursor is over a graph in document
"B" the belonging lable which is located in the parent svg document
"A" to change color or size.

Or I whant the graph in "B" to start blinking as soon as the mouse is
over the lable in "A".

I don't know how cross document borders.

Can anyone give me a short exapmle to get me going ?

Juergen Flosbach
Jul 23 '05 #1
3 2402


flosi wrote:

I have a svg document embedded in another svg document. I whant,
through functions in an external javascript file, manipulate objects
in either the child svg document or the parent document.
How do I get access to elements of the other document ?


I think with Adobe SVG viewer version 3.x you do not get access to
embedded document.
I don't know about other viewers.
In general I think the SVG 1.2 draft acknowledges that so far (that is
in SVG 1.0 and 1.1) the scripting of embedded documents has not been
addressed, as
http://www.w3.org/TR/SVG12/dom.html
says:
"There is an oversight in the SVG 1.0 DOM in that the SVGImageElement
interface does not allow access to the DOM of the image it refers to (if
that image is an SVG document)."
And then:
"To provide this functionality, SVG 1.2 adds a document attribute to
the SVGMedia interface, which is the Document interface of the
referenced meda, if one is available. It is unlikely that the SVG
specification will describe the format for the returned Document except
in the case of a referenced SVG image."
Thus if a viewer implements the current SVG 1.2 draft you would need to
access the <image> element and that should have a property named
document to access the embedded document.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
On 30 Nov 2004 07:18:01 -0800, ju**************@bigfoot.com (flosi)
wrote:
I have a svg document embedded in another svg document. I whant,
through functions in an external javascript file, manipulate objects
in either the child svg document or the parent document.
How do I get access to elements of the other document ?


As Martin said, you can't do this. In batik or ASV 6 preview you
could do it by having the 2nd document USE the part from the 2nd file,
but not in ASV3, so I'd stay away, why not just have a single file,
are you really saving much splitting it into two?

Jim.
Jul 23 '05 #3
ji*@jibbering.com (Jim Ley) wrote in message news:<41****************@news.individual.net>...
On 30 Nov 2004 07:18:01 -0800, ju**************@bigfoot.com (flosi)
wrote:
I have a svg document embedded in another svg document. I whant,
through functions in an external javascript file, manipulate objects
in either the child svg document or the parent document.
How do I get access to elements of the other document ?


As Martin said, you can't do this. In batik or ASV 6 preview you
could do it by having the 2nd document USE the part from the 2nd file,
but not in ASV3, so I'd stay away, why not just have a single file,
are you really saving much splitting it into two?

Jim.


Thanks. That helps me with my decision. I used batik all along and
batik doesen't have a problem with nested SVG documents. But the ASV3
has as you mentioned. So, I 'll put everything in one document and the
scripting will be easyer.

Thanks for the info.

Juergen Flosbach
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Quest Master | last post by:
I am interested in developing an application where the user has an ample amount of power to customize the application to their needs, and I feel this would best be accomplished if a scripting...
14
by: Michele Simionato | last post by:
I would like to know what is available for scripting browsers from Python. For instance, webbrowser.open let me to perform GET requests, but I would like to do POST requests too. I don't want to...
9
by: Vijai Kalyan | last post by:
Hello All, I have a few questions which you might seem irrelavant and/or foolish. I am asking anyway so I can find out. 1. Is XSL as powerful as a programming language such as Java in its...
4
by: Etienne Fortin | last post by:
Now that VSA is dead, what can we do to implement scripting in .NET? I know this question was aked a couple of time, but .NET never really adressed the "scripting" side of programming. Even VSA was...
17
by: Karl Irvin | last post by:
To use the Textstream object, I had to set a Reference to the Microsoft Scripting Runtime. This works good with A2000 Is the Scripting Runtime included with A2002 and A2003 so the Reference...
9
by: deko | last post by:
I need to create a Recordset of all records that appear in one table but do NOT appear in another. To get the records that appear in BOTH tables, I can do this: SELECT tblEntity.Entity_ID...
2
by: kw | last post by:
TextBox t=new TextBox(); Controls.Add(t); t.ID=t.ClientID; //reads: "_MyControl1__ctl16" And even in OnPreRender, I examine the Controls collection and verify that the ID of the TextBox is...
77
by: Peter Olcott | last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html The above link shows that C# is 450% slower on something as simple as a nested loop....
1
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have problems loading XML data into SQL Server. What is the best way to go ? I am new in using XML documents. I have tried to do it with "Integration Services" and also with...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.