Re: following white space

Subject: Re: following white space
From: Peter Nilsson <pnidv96@xxxxxxxxxxxxxx>
Date: Thu, 2 Dec 1999 14:05:37 +0100 (CET)
On Thu, 2 Dec 1999, Peter Bennett wrote:

> all appears fine, but I need to add a decent amount of whitespace under
> a processed xml element.
> I  want to do this by, appending make element "BR" in my style sheet.
> The problem is that, the appended element(s) end up encasing the
> original element in the final HTML.
> e.g. I end up with <BR><BR>my element</BR></BR>   rather than the
> desired  my element<BR></BR><BR></BR>
You are probably caught by the implicit (process-children) which is added
to as content to a non-atomic flow object if there is no content. So, if
you say
(make element gi: "br")
, it will be treated like
(make element gi: "br" (process-children))

To avoid this, add an empty sosofo as content:
(make element gi: "br" (empty-sosofo))

However, in this particular example, you'd better use an empty element,
since HTML declares BR as EMPTY. A more complete example would be:
(element foo
  (sosofo-append    ; Or (make sequence if you like
    (make empty-element gi: 'br)

(The make expression is described in §12.4.3 in the DSSSL spec.)

Best Regards,
/Peter Nilsson

'(#\P . (#\e . (#\t . (#\e . (#\r)))))

 DSSSList info and archive:

Current Thread