[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-users
Subject:    Re: Reg: Accessing SVG DOM tree using Java
From:       Shamjith K V <shamjithkv () cdacb ! ernet ! in>
Date:       2005-09-16 12:50:26
Message-ID: 432ABCC2.8010604 () cdacb ! ernet ! in
[Download RAW message or body]

Hi Thomas,
Thankyou so much,
That worked well...

Shamjith K V :-)

Thomas DeWeese wrote:

> Hi Shamjith,
>
> Shamjith K V wrote:
>
>> what I want to try is how to embed a script like as given below.
>>
>> <svg width="450" height="500" viewBox="0 0 450 500">
>>    <script type="text/ecmascript">
>>    function showDialog(msg) { alert(msg); }
>>    </script>
>
>
> You do it the same way as for the rect more or less:
>
>    String scriptText = "function showDialog(msg) { alert(msg); }";
>    Element script = doc.createElementNS(SVGNS, "script");
>    Node    text   = doc.createTextNode(scriptText);
>    script.appendChild(text);
>    doc.getDocumentElement().appendChild(script);
>
> Note that I don't think squiggle will dynamically evaluate
> script elements if they are added to the document at run time
> (however you can 'eval' arbitrary strings if you need to).
>
>> I meant about the "<script> function ....</script>" part
>> Can you please help me in finding the solution for this.
>
>
>    You might want to review the DOM level 2 APIs
> (in particular "Core"):
>     http://www.w3.org/DOM/DOMTR#dom2
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic