Re: Recognizing "subdocuments"

Subject: Re: Recognizing "subdocuments"
From: Brandon Ibach <bibach@xxxxxxxxxxxxxx>
Date: Fri, 4 Dec 1998 17:35:11 -0600 (CST)
W. Eliot Kimber said:
> 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.
   I can't really comment on this with any authority, but there are a
couple of items in the spec that talk about things which seem to be
   Section 9.5 (in the "groves" chapter) talks about generating
"auxiliary groves" via an "auxiliary parse", and that the DSSSL engine
should generate a urefnode property for each new node called "source"
which points back to the nodes in the "source grove" from which the
node was generated.  So, this could be one solution (if implemented
in the engine).  The question would be, would the sgml-parse function
qualify as an "auxiliary parse"?
   Also, the transformation language has the concept of "arrows" from
the transformation source to the newly created nodes.
   Upon some reflection, neither of these seem like a perfect model
for linking in other documents, but the former seems like a better
fit than the latter, and it probably wouldn't be difficult to work
into Jade (he says so casually, without really knowing what it would
entail) if an appropriate model could be worked out.

-Brandon :)

 DSSSList info and archive:

Current Thread