Re: Recognizing "subdocuments"

Subject: Re: Recognizing "subdocuments"
From: "W. Eliot Kimber" <eliot@xxxxxxxxxxxxxx>
Date: Fri, 04 Dec 1998 09:59:18 -0600
At 05:07 AM 12/4/98 -0500, Norman Walsh wrote:
>Suppose that I have a stylesheet that uses (sgml-parse) to load
>other documents and then calls (process-node-list) on some
>subset of the elements in the document so loaded.
>
>Is it possible in Jade to write a function that can tell if a node
>comes from "the original" document or from one of the documents
>that I've loaded with sgml-parse?

As long as you have both nodes, you can always compare their grove roots to
see if they are the same, e.g.:

(define (in-same-grove? node1 node2)
  (if (equal? (grove-root node1) (grove-root node2))
    #t
    #f))

Unfortunately, in the current DSSSL spec, there is no defined way to look
up from the root of a parsed subdoc to see the point at which it was
referenced.  This would, I think, be a relatively easy extension to write.

Note that in a HyTime-aware environment, the HyTime engine would maintain
this knowledge for you because it maintains tables of all the node-to-node
addresses. If the HyTime system implements the value reference facility, it
will also maintain knowledge of those addresses that establish
use-by-reference relationships.

I realize that Jade is not currently implemented on top of any HyTime
engines, but it soon will be implemented (or implementable) on top of
TechnoTeacher's GroveMinder/HyMinder system.  You could also put it on top
of my PHyLIS tool, which provides a HyTime engine as well (although I
haven't yet fully implemented the location address part of the HyTime
semantic grove, if someone really wanted it, it wouldn't take long to add).

Cheers,

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>


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread