473,513 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2407


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
2692
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 language was available. However, I want to code this application in Python, and I have not yet heard of an implementation of another scripting language...
14
2783
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 use urllib to emulate a browser, I am interested in checking that browser X really works as intended with my application. Any suggestion? ...
9
2266
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 abilities to transform XML? The W3C site has the following definition on XSLT for example: "XSLT is designed for use as part of XSL, which is a...
4
1576
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 lacking, which is probably the reason why Microsoft is just killing it right now. So, what's the best way to do scripting "out-of-the-box"? And...
17
4178
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 won't be broken when my app is opened with those versions. Also is the Scripting Runtime included as part of the A2000 Runtime Engine which some of...
9
20091
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 FROM tblEntity INNER JOIN tblDocuments ON tblEntity.Entity_ID = tblDocuments.Entity_ID;
2
1897
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 "_MyControl1__ctl16". But then, on the final HTML rendered, if you look at the page, the textbox looks like this:
77
5152
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. Is this because .NET is inherently slower or does the C# compiler merely produce code that is not as well optimized as the C++ compiler?
1
1711
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 "XmlTextReader", "XPathDocument", "DataSet.ReadXML" ... None of this is working well because my XML document has nested tables and in XML documents I dont...
0
7273
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7181
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7399
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7570
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7131
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7545
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5707
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4763
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
1615
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.