[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: Flattening a tree


Subject: RE: Flattening a tree
From: Jeni Tennison <Jeni.Tennison@xxxxxxxxxxxxxxxx>
Date: Fri, 14 Jul 2000 19:09:37 +0100

Pierre-Yves,

>As I was saying is the first message of this thread, the problem is to
>differentiate two categories of elements : those which must be flattened and
>those which must not. The first category must be layed out verticaly (let's
>call them "paragraphs") with no nesting. The other category (inlines) must
>be layed out horizontaly, with whatever level of nesting is needed.

Changing the input is a sure way of stopping a solution working! ;)  I
hadn't grasped that this was what you meant by inline, and am still a
little confused about which of the elements are inline and which are not.
Is 'List' inline?  Is 'Item' inline?

My current hypothesis is that it is whether the element contains an
'inline' element that determines whether it should be flattened or not.
>From the two examples that you've sent, I've come up with the following rules:

1. all elements that contain text and only elements that are not 'inline'
are copied and flattened (e.g. para)
2. all elements that contain text and do not contain elements that are not
'inline' are copied and not flattened (e.g. Item, i)
3. all elements that are empty are copied (e.g. inlineGraphic, graphic)
4. all elements aside from the document element, that contain only elements
are not copied (e.g. List)
5. the document element is copied (e.g. document)

Even given these rules, I'm not sure what would happen if you had an
element that contained text and a mixture of 'inline' and 'non-inline'
elements.  For example, an input of:

<document>
  <para>
    content-1
    <i>italic</i>
    content-2
    <List>
      <Item>content-3</Item>
      <Item>content-4</Item>
    </List>
  </para>
</document>

If you:
(a) tell me what the above input should give (or let me know I needn't
worry about it)
(b) confirm that the rules that I've given above are the (only) ones that
are applying, and 
(c) give me a list of the elements that are 'inline' ('i' and
'inlineGraphic' are the only two you've specified so far)
then I will try my best to create a stylesheet that will do what you want
it to do.

Sorry that I can't be more help right now,

Jeni

Dr Jeni Tennison
Epistemics Ltd, Strelley Hall, Nottingham, NG8 6PE
Telephone 0115 9061301 ? Fax 0115 9061304 ? Email
jeni.tennison@xxxxxxxxxxxxxxxx



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread