Marhsalling DOMNode's between languages

"john_f_mclaughlin" <[email protected]> Wed, 19 Jul 2006 21:15:18 -0000
Newsgroups gmane.comp.web.dom.wdf
Message-ID <[email protected]>
Hi All,

I hope this isn't too basic of a question... I've done a bunch of
research and I can't seem to get quite clear the best way of doing
something.

I've got a little app that is partly written in Javascript and partly
written in Objective-c.  What I'd like to do is to be able to pass
DOMnodes between the two languages and I'm not sure what the best way
to do this is.

In fact, I've only puzzled out one method so far.  Use the ID of the node.

My basic idea is when I want to move the Node between the languages I
first check to see if it has an ID assigned.  If it does then I pass
back the ID. If it doesn't I create and assign a ID for the object and
then pass back that newly created ID (as a string)

On both sides I can use getElementByID to get the actual object back
in their respective languages.

While I haven't coded this up yet I think it should work but I'm
worried I'm missing something obvious.  Is there a better way of doing
this?

As a final question:  I assume I can attach an ID to a node creating
an element of type 'id' and assigning my (temporary) id to it and then
attaching it to the DOM node with SetAttributeNode (correct?)

Thanks
-John






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/9rHolB/TM
--------------------------------------------------------------------~-> 

Unsubscribe
[email protected]

List info
http://www.quirksmode.org/dom/list.html 
Yahoo! Groups Links

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

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