RE: Creating new element from nothing (in The DSSSList Digest V3 #155)

Subject: RE: Creating new element from nothing (in The DSSSList Digest V3 #155)
From: "Maltby, David G" <david.g.maltby@xxxxxxxx>
Date: Mon, 30 Aug 1999 06:39:06 -0700
MARK.WROTH@xxxxxxxxxxx replied (with editing by dgm to reduce length):
> David Maltby <david.g.maltby@xxxxxxxx> asked:
> >I need to perform the following -tsgml transform which
> >introduces a new element 'x', a child of 'a' but a sibling to 'b'.
> >
> >Source:
> > <A> <B></B> </A>
> >
> >Result: 
> > <a> <x></x> <b></b> </a>
> 
> and suggested a formatting instruction as a solution.
> 
> My inclination would be to simply use a make sequence, as in 
> 
> (element A
>   (make element gi: "a"
>     (make sequence
>       (make element gi: "x")
>       (process-children))))
> 
> (element B
>   (make element gi: "b"))
> 

This would do the trick with a small modification.  As written it would
produce:
 <a> <x><b></b></b> <b></b> <a> because of the implied (process-children) in

(make element gi: "x").  The following modified style-sheet produced the
result I was seeking:

(element A
  (make element gi: "a"
    (make sequence
      (make element gi: "x" (empty-sosofo))
      (process-children))))

Of course, the implicit (process-children) or some possible sequence of
sosofos may be appropriate in another application.  It turns out that the
(make sequence) is not required to make this rule work.  That is,

(element A
  (make element gi: "a"
    (make element gi: "x" (empty-sosofo))
    (process-children)))

produces the same result (credit Joerg Wittenberger).  Although I do little
page oriented styling, it seems that (make sequence) is most applicable in
this domain.  If it useful in the domain of  jade -tsgml transformations I
would like to know more about the context where (make sequence) fits in.

Thank you for the input.

Regards,
David Maltby, IETM Team, Lockheed Martin Missile and Space
"Transforming instances conforming to one DTD into instances conforming to
another DTD"
(credit GKH)




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


Current Thread