>OK, so now I'm a little confused. The term DOM, in my mind, brings up the
>image of a tree of objects within a specified environment, such as a web
>browser, as a reference for programmers to determine which objects and
>properties go where, how they relate and what they do within that
>environment.
>
>If my image of a DOM is correct then surely a Lingo DOM will revolve around
>Director as that environment and will fully detail, in effect, Director's
>movie objects so that we developers can get Director to do what we want
>through the use of the Lingo scripting language?
>
>With this clouding my mind, describe to me exactly what you are trying to
>produce.

You have to divorce yourself from the concept that a Lingo-based DOM
implementation necessarily relates directly to Director movie entities like
sprites, members, casts, etc. Symantically, I suppose it could, if you
wanted it to...but it would be entirely up to the developer to reimplement
my DOM objects in that context. What you already know and love about
Director isn't being modified or obfuscated somehow by what I'm producing.
I'm not laying a DOM over the Director objects in your movies. What this is
is a pure and simple implementation of the Document Object Model API in
Lingo.

Every part of this DOM implementation lives and breathes within the context
of Lingo. The formal interfaces are defined in parent scripts, which you
create child objects from (or use the factory methods of the objects to
create them for you). The various child objects implement the Document
interface, the Element interface, the Attr interface, the CDATASection
interface, etc. Ancestors are established to create the inheritence trees
specified by the DOM. For example, just about every object implements and
extends the Node interface (another parent script), where common methods for
referring to the nodes in an XML tree reside. Also, everything is
"subclassed" to a DOMExceptions object for reporting any exceptions raised.
Parent objects have child objects added to them, and they in turn have child
objects added to them. You use this DOM implementation to create and nest
these objects in memory to form a tree which describes an XML document.

Again, in the hopes of making things perfectly clear, here's a chunk of
Lingo that demonstrates the pervue of this DOM implementation.

loImpl = new(script "DOM_DOMImplementation")
loDocType = loImpl.createDocumentType("company")
loDoc = loImpl.createDocument(VOID, "company", loDocType)
loRootElem = loDoc.getDocumentElement()
loProdElem = loDoc.createElement("product")
loRootElem.appendChild(loProdElem)
loProdDataVal = loDoc.createTextNode("XMLingo")
loProdElem.appendChild(loProdDataVal)
loCatElem = loDoc.createElement("category")
loRootElem.appendChild(loCatElem)
loCatElem.setAttribute("idea", "great")
loCatDataVal = loDoc.createTextNode("DOM Implementations")
loCatElem.appendChild(loCatDataVal)
loDevByElem = loDoc.createElement("developedBy")
loRootElem.appendChild(loDevByElem)
loDevByDataVal = loDoc.createTextNode("Christopher Watson")
loDevByElem.appendChild(loDevByDataVal)

As you can see, this all about data. It's Lingo very hard at work, but
nothing about it is linked into the native Director movie structure. The
above code creates the following XML document fragment in memory:

<company>
  <product>XMLingo</product>
  <category idea="great">DOM Implementations</category>
  <developedBy>Christopher Watson</developedBy>
</company>

My implementation also contains support for the DOM Views module. The
default view for documents in my implementation is the well-formed textual
representation of it. So after using the above code to create the document
in memory, you use the viewDocument method to output the formatted XML text
you see above. You could ship that XML from your Shockwave application or
game back to a server in a POST request.

I also support the Traversal and Range modules, so you can use NodeIterators
and TreeWalkers to step through the nodes in a tree in document-order or by
selectively walking up to parent nodes, over to siblings, or down through
children. There's also support for NodeFilters, which perform live filtering
on the node lists built by NodeIterators and TreeWalkers, so you can see
only what you want to see out of the document.

It's all Lingo, all the time.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Christopher Watson
Sr. Software Engineer
Lightspan, Inc.
http://www.lightspan.com/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to