* wi2fish wrote:
><?xml version="1.0"?>
><svg onload="replacetext(evt)" >
>    <script xlink:href="nodes.es" />
>    <text id="sampletext" y="20">
>       <tspan x="5" dy="1em">line 1</tspan>
>       <tspan x="5" dy="1em">line 2</tspan>
>       <tspan x="5" dy="1em">line 3</tspan>
>    </text>
></svg>
>
>(By the way, I wanted to put this into one file instead of two, but
>then I would have had to know this strange CDATA syntax... Who on
>earth invented that?)

You never need <![CDATA[]]> sections, they are just a convenience
mechanism so you don't have to escape XML's special characters &,
< and >,

  <script ...><![CDATA[if (1 < 2) ...]]></script>

and

  <script ...>if (1 &lt; 2) ...</script>

are equivalent.

>I understand that the tspan tags are children of the text tag, but
>this doesn't explain why there are seven childNodes of the text and I
>can't seem to descent more down the tree with
>childNodes.item(i).childnodes.

You could prefix the nodes with NodeX,

    <text id="sampletext" y="20">Node1:
        Node2:<tspan x="5" dy="1em">line 1</tspan>Node3:
        Node4:<tspan x="5" dy="1em">line 2</tspan>Node5:
        Node6:<tspan x="5" dy="1em">line 3</tspan>Node7:
    </text>

As you can see, the text nodes that contain only white-space are nodes
too, if you just want the tspan children you could use the function
getElementsByTagNameNS() or you can iterate over the nodes and check
the node type for element nodes.
-- 
Bj�rn H�hrmann � mailto:[EMAIL PROTECTED] � http://bjoern.hoehrmann.de
Weinh. Str. 22 � Telefon: +49(0)621/4309674 � http://www.bjoernsworld.de
68309 Mannheim � PGP Pub. KeyID: 0xA4357E78 � http://www.websitedev.de/ 


-----
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