Using XML-Capable Web Browser Widgets: Part 1 IE5B2 WebBrowser Control

W. Eliot Kimber eliot at dns.isogen.com
Wed Nov 25 16:13:52 GMT 1998


Ok, enough abstract stuff. Let's do some real work.

Both IE5 and Mozilla now support the direct presentation of XML documents.
This is very cool.  I'm trying to use these new facilities to provide
SGML/XML browsing of groves through PHyLIS and I can't figure out how to do
what I want (or even if what I want to do is possible in the way I think I
want to do it). I thought I'd ask my questions here because it's likely
that someone else may have the same questions and that the answers will be
of benefit to all. I also assume that the relevant technical people track
this list.

Background: how PHyLIS works

PHyLIS (<http://www.phylis.com>) is a generalized system for managing and
browsing groves constructed from any type of data you wish to provide grove
constructors and renderers for.  It provides public classes for grove
constructors and grove renderers, where a grove renderer is an object that
takes a grove as input and produces some useful presentation.

PHyLIS is also a HyTime system in that it provides full HyTime hyperlink
awareness to all grove constructors and renderers. It provides a basic
traversal service such that any grove renderer can determine which of the
nodes it is rendering are linked to anything else and can therefore inform
the PHyLIS server when someone tries to traverse from one of those nodes
(e.g., you click on an element that is linked to something else).  By the
same token, PHyLIS will inform grove renderers when someone traverses to a
node they are rendering.

Thus, a PHyLIS grove renderer must be able to do the following things:

1. Translate user actions against the presented view of the grove into
specific grove nodes. That is, if I click over something, the renderer has
to know what node or nodes that is so it can inform the PHyLIS server of a
traversal initiation action.  Thus a grove renderer has to maintain a
mapping between the data structures used in the rendition and the grove
nodes themselves.  This can be a challenge depending on how the rendition
is actually constructed.

2. Be able to communicate with the PHyLIS server's grove memory to examine
the HyTime link information grove in order to determine if any of the nodes
it's rendering are linked (the HyTime grove provides a list, indexed by
node, of all the nodes that are linked to something).

3. Be able to translate a node into a position or control in the presented
view of the grove in order to reflect a "node traversed to" action.  That
is, when a node is traversed to, PHyLIS will inform the renderer(s) of that
node of the action.  The renderer then does whatever it does (e.g., change
a color, issue a message, scroll to the point, launch a new window, whatever).

This is a pretty simple system that makes it easy to integrate new grove
renderers that have instant ability to participate in all links--no grove
renderer need have any knowledge of any other grove renderer in order to
participate fully in interactive linking.  Because this all happens at the
grove level, the linking is entirely independent of the data types being
linked.

For SGML and XML documents, I want to construct more jazzy renderers then
my current lame tree-view renderer.  It looks like the IE5 WebBrowser
control and the NGLayout control from Mozilla are just the ticket--both are
COM controls, both support the DOM, and both provide high-quality
presentation.

However, I haven't been able to figure out how to integrate these things.
In particular, I haven't been able to figure out how, or if, I can pass a
pre-existing DOM to the IE5 WebBrowser and have it browse it. I expected to
find a "DomRoot" property or a "PutDomHere()" method, but didn't see
anything likely using the class browser in VB5.  I will want to do the same
thing with the NGlayout control, but I haven't gotten it properly installed
yet, so I don't know if there is an obvious way to do it yet.

I can easily use the MSXML control (or its equivalent) to construct a DOM
and wrap PHyLIS' grove API around the result--works great and no
programming difficulty at all.

I think I could also use the WebBrowser control to construct the DOM in its
memory and use that, but when I tried loading an XML document and then
using the DOM-access API, I only found an HTML DOM, not the original XML DOM.

So my questions:

1. Is there a way to pass a pre-existing DOM to the WebBrowser widget?
2. If so, is there way to associate a style sheet (either CSS or XSL) with it?
3. If not, could the IE5 folks consider adding such a facility? I doubt I'm
the only person constructing DOMs outside a browser who wants to then
browse them.
4. Have I missed the obvious and overlooked some natural and easy way to do
what I want?  Is there some secret?
5. Does the IE5 control preserve the XML DOM somewhere when it loads and
renders an XML document?  If so, where is it?

I could serialize my DOM back to syntax, but that would be both egregiously
inefficient and, in the abstract, unnecessary and would loose the
connection between the DOM/Grove in the grove renderer object and the DOM
being presented by the browser widget.

Thanks,

E.
--
<Address HyTime=bibloc>
W. Eliot Kimber, Senior Consulting SGML Engineer
ISOGEN International Corp.
2200 N. Lamar St., Suite 230, Dallas, TX 75202.  214.953.0004
www.isogen.com
</Address>

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list