473,652 Members | 2,979 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Read SVG (using JavaScript) H - E- L - P ! ! !

How can I use EXTERNAL JavaScript code to read (and modify) an SVG
file/object? Can JavaScript do this or do I have to resort to Batik?

IMPORTANT NOTE:
The JavaScript code CANNOT be embedded in the SVG file, because it is
server-side generated.

Thank You
- Olumide

Jul 20 '05 #1
5 2230
Olumide wrote:
How can I use EXTERNAL JavaScript code to read (and modify) an SVG
file/object? Can JavaScript do this or do I have to resort to Batik?

IMPORTANT NOTE:
The JavaScript code CANNOT be embedded in the SVG file, because it is
server-side generated.

Thank You
- Olumide


Do you need to save the modifications? If not, just load it like any
other XML document (through XmlHttpRequest( ) or createDocument( ) and
document.load() ), and use the DOM to manipulate it.

-Jason Davis

Jul 20 '05 #2
Olumide wrote:
How can I use EXTERNAL JavaScript code to read (and modify) an SVG
file/object? Can JavaScript do this or do I have to resort to Batik?


I have an example of reading and rendering VML using JavaScript, which you
may find helpful: http://www.stirbitch.com/steve/smml/index.html
Jul 20 '05 #3

... just load it like any
other XML document (through XmlHttpRequest( ) or createDocument( ) and
document.load() ), and use the DOM to manipulate it.


Thanks Jason, I will look into this. The problem however is that I have
a multiframe document that looks like this:
|-----------------------------------------------|
| | |
| | |
| | |
| | |
| Left Frame | Right Frame |
| [SVG] | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
|-----------------------------------------------|

The Left Frame is an SVG object while the Right Frame is a an HTML
document with JavaScript code in its head section. My intention is to
have the SVG object (in the left frame) modified by the javascript code
in the right frame. (The HTML document in the right frame is server-side
generated.)
Er ... can document.load() still "load" the SVG document even though it
is already loaded in the left frame?

Thanks
- Olumide

Jul 20 '05 #4
Can't you just go:

top.leftframena me.document

And reference the SVG document that way? With the Adobe SVG Viewer you
might have to rely on method calls (I don't have much experience with
the ASV DOM implementation) , but in Mozilla you should be able to access
the SVG document like that, and use standardized DOM interfaces (DOM2
Core and the SVG DOM for example) to manipulate it on the fly.

-Jason Davis

Olumide wrote:

... just load it like any other XML document (through XmlHttpRequest( )
or createDocument( ) and document.load() ), and use the DOM to
manipulate it.



Thanks Jason, I will look into this. The problem however is that I have
a multiframe document that looks like this:
|-----------------------------------------------|
| | |
| | |
| | |
| | |
| Left Frame | Right Frame |
| [SVG] | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
|-----------------------------------------------|

The Left Frame is an SVG object while the Right Frame is a an HTML
document with JavaScript code in its head section. My intention is to
have the SVG object (in the left frame) modified by the javascript code
in the right frame. (The HTML document in the right frame is server-side
generated.)
Er ... can document.load() still "load" the SVG document even though it
is already loaded in the left frame?

Thanks
- Olumide


Jul 20 '05 #5

Jason Davis wrote:
Can't you just go:

top.leftframena me.document

And reference the SVG document that way? With the Adobe SVG Viewer you
might have to rely on method calls (I don't have much experience with
the ASV DOM implementation) , but in Mozilla you should be able to access
the SVG document like that, and use standardized DOM interfaces (DOM2
Core and the SVG DOM for example) to manipulate it on the fly.


Can anyone provide a hint or (web) link showing how this can be done?

Thanks

- Olumide

Jul 20 '05 #6

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

Similar topics

2
25205
by: sriram pasham | last post by:
Hi Could any one tell me how to access(read) a registry key using javascript from a webpage(ASP page). Thanks in advance. Sriram *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
3
68765
by: Rick Edwards | last post by:
Can I do this? If I'm passing info in my HTTP headers, can I read this info via Javascript? I've seen some hope out there, but nothing definitive - I'm hoping to get that answer here.... TIA Rick
9
3432
by: Randell D. | last post by:
Folks, I can program fairly comfortably in PHP and can, for the most part using these skills and others that I've picked up over the years manage to read/understand most code in Javascript... so I'm just asking for a few pointers (or the full solution if you have the time) for what I want to do. Basically, I want to write a javascript wherby I only need to pass it the names of form fields - then my javascript will check each form field...
5
6330
by: Doug | last post by:
I would appreciate a response on this. I have clients who will be placing text files information about in a network directory for example: http://www.protegen.com/clients/ Is it possible to read these text files using either vbscript or javascript. What I am attempting to do is to read these files and then create charts for viewing by each client. A direct email to me at douglas.taylor@protegen.com will help.
14
4340
by: Randell D. | last post by:
Folks, Here's my problem: I am createing an array in a file using the reslut of some PHP and MySQL processing. An example of my array would be examlpe="example one"; examlpe="example two"; examlpe="example three";
4
1938
by: Cloud Burst | last post by:
I'm writing a javascript for my own use. I'd like it to read my disk to get some information. In particular, I want to find out how much disk is being used by some directories. At present, I'm pasting the output of a command line "du -s" into some text fields and using that information. As I understand it, for security reasons javascript isn't allowed to do disk input/output. Please correct me if I'm wrong.
0
1671
by: David Virgil Hobbs | last post by:
While studying the asp.net javascript problem I saw and used pages about asp.net basics at http://www.sitepoint.com/article/815/4 and http://www.aspfree.com/c/a/ASP.NET/ASPNET_Basics_part_1_Nothing_But_Net/3/ I have put together an aspx page ( http://www34.brinkster.com/vincemoon/3assignment.aspx ) wherein I attempt to read and write to normal html non asp.net form inputs using vb/asp.net; in the page I also attempt to read and write...
17
3443
by: chris.schwalm | last post by:
I would like to first state that I have searched through the archives and found a lot of related material, but am still new enough to javascript that I can't fit all the pieces together yet. So here is my situation. I would like to create a program that grabs the source of a displayed webpage, sends it off to another program, then receive the slightly modified source back from that other program, and then reposts the slightly modified...
5
24386
by: subbulakshmi | last post by:
hi how to read data from XMLDocument by using Javascript. i got coding from internet. but its not read data. help me its in JavaScript ----------------------- //server return XML Document var xmlDoc=xmlHttp.responseXML.documentElement;
1
3609
by: bpejman | last post by:
Hi Everyone, I've been reading and searching the web for days trying to figure out how exactly you can access and read a Perl array or hash from within JavaScript. I've been reading that JSON is the way to go, but non explain exactly how. If you can help me out, I would really appreciate it. Here's the scenario I have... I have a perl file called index.pl and in this file I have the below code. I know that arrays are converted to...
0
8367
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8589
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5619
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4145
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2703
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
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.