Hello Willem,

first you can use another  set of  javascript  methods to replace text 
in a textnode:

(svgdoc.getElementById(yourNodeId)).firstChild.nodeValue=text;

It seem like you want to add the tag <tspan> as text, but this is also a 
node (like all others).
Therfore you should use the methods like createElement(tagName) etc. of 
the javascript document object an use the appendChild() method of the 
node object.
If you use the ASV you possibly can use the parseXML method of object 
window to do it like you explained it below, but this is imho no the 
best of all ways.

To get started with SVG try a few tutorials (i think 
http://www.datenverdrahten.de/svglbc/ is a good place to do so) after 
that the W3C documents will be good for references (yes i read the specs 
of the w3c :).
For the JavaScript Thing, the Oreilly Quick and Dirty references are ok, 
but not for all cases (due to the html focus). For ASV download the 
specs from adobe and you'll find more possible methods.


michael

>
> Sorry for that simple question, I just started with SVG & co.
>
> Is there a web resource where I can find answers to such questions as
> the one below? Like a reference or a comprehensive tutorial? (I've
> seen many tutorials by now, but they don't include answers to every
> question I might have.) What references do you use? I find the w3c
> documents hard to read, does anyone really read that?
>
> Short version of my question:
>
> I can't seem to be able to manipulate text with setData() if it
> includes the <tspan> tag.
>
> Long version:
>
> I declare a text box with
>
> <text id="helloText" onload="identifyText(evt)">
> This is some text
> </text>
>
> If I replace "This is some text" with "<tspan>This is some
> text</tspan>", then I get exactly the same display.
>
> However, in the javascript file, if I use
>
> function identifyText(evt) {
>   textContent = evt.target; // one way of getting the object
> }
>
> and somewhere else
>
> textContent.getFirstChild().setData("This is the replacement text");
>
>
> Without using tspan, this works fine, the text gets overwritten.
>
> If I use tspan in the declaration, then both texts get appended
> instead of replaced (not one above the other but one after the
> other!).
>
> if I use tspan with setData()
>
> textContent.getFirstChild().setData("<tspan>This is the replacement
> text<tspan>");
>
> then it doesn't work at all.
>
> How do I do it?
>
> Greetings Willem
>
>
>



-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to