File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SVG javaScript method to set text content

 
Juan Rolando Prieur-Reza
Ranch Hand
Posts: 237
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 237
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic