Re: Processing Siblings As Though They Were Children

Subject: Re: Processing Siblings As Though They Were Children
From: Chris Maden <crism@xxxxxxxxxxx>
Date: Thu, 22 Oct 1998 19:36:38 -0400 (EDT)
[W. Eliot Kimber]
> I'm doing a DTD-to-DTD conversion and I've run into a situation that
> I can't figure out an easy way to solve.
> 
> I've got an input content model that looks like this:
> 
> <!ELEMENT containter1
>   (A?,B?,C?,
>    (SubHead, A?, B?, C?)*)
> >
> 
> On the output, I want to put any occurrence of "SubHead, ..." into a
> common container.
> 
> I know I can loop over the children of container1 explicitly. What I
> can't figure out--and I suspect I'm missing something fundamental or
> obvious--is how to inject the container element into the output so
> that its content is the result of processing subsequent As, Bs, and
> Cs, but not SubHeads.

(element containter1
	 (make element
	       gi: "level-1-container"))

(element SubHead
	 (make element
	       gi: "level-2-container"
	       (make element
		     gi: "level-2-title"
		     (process-children))
	       (process-node-list (node-list-filter ...[1]))))

[1] is, of course, the interesting bit, but I have to go.  I would
iterate (probably in a procedure) over the following siblings, consing
elements until I hit another SubHead or ran out of siblings.

-Chris
-- 
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>


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


Current Thread