This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes SVG javaScript method to set text content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SVG javaScript method to set text content" Watch "SVG javaScript method to set text content" New topic
Author

SVG javaScript method to set text content

Juan Rolando Prieur-Reza
Ranch Hand

Joined: Jun 20, 2003
Posts: 236
Hi,
Can someone tell me how to set the text content of an SVG text Element
in javascript (ecmascript)?

Here is a sample of the problem:

My question is, what is the setmethod??, or the name of an "attribute" that will assign the text to this SVG text Element?

Explanation: The sample code illustrates how to use javaScript to create and set attributes to SVG elements such as rect, circle, and text (assuming you just want to modify attributes of a known text element by its "id").
I just can't find how to set the body content. Static SVG code will not suite my application.

Thanks for your help.


Juan Rolando Prieur-Reza, M.S., LSSBB, SCEA, SCBCD, SCWCD, SCJP/1.6, IBM OOAD, SCSA
Juan Rolando Prieur-Reza
Ranch Hand

Joined: Jun 20, 2003
Posts: 236
Oh, nevermind. I figured it out. The solution is to make the text content a child. I just had to find the method to set child:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SVG javaScript method to set text content