xsl-list
[Top] [All Lists]

RE: [xsl] Constructing a tree from leaf nodes (knowing the tree structure)?

2007-04-19 23:16:23
Trevor,

Thank you for providing a clear, generic problem definition.  I've made a
couple of minor changes to the third bullet in a) and b) and the addition of
a fourth bullet to b).

Regards, Simon

****************************

There is a structure tree and a data tree.
The structure tree is fixed and complete.
The data tree is variable and may contain any element which corresponds to a
descendant-less node (leaf node) in the structure tree (at most one of each
element).

The required output is a merge of the structure tree and the data tree,
where:
 a) for any specific descendant-less (leaf) node in the structure tree:
   - if the data tree contains a matching node with @result true
     then @complete=true and @result=true
   - if the data tree contains a matching node with @result false
     then @complete=true and @result=false
   - if the data tree does not contain a matching node
     then @complete=false and @result=true (because I do not want 
     to affect the logical AND value of ancestor nodes' @result value
     when they include leaf nodes with @complete=false - see third bullet
     in b) below)

 b) for every other internal node in the structure tree:
   - if the data tree contains every descendant leaf node with @result true
     then @complete=true and @result=true
   - if the data tree contains every descendant leaf node but not all
     results are true then @complete=true and @result=false
   - if every descendant leaf node has @result=true then the internal node 
     will have @result=true (even if one or more leaf nodes have
     @complete=false)
   - if any descendant leaf node has @result=false then the internal node 
     will have @result=false

****************************

-----Original Message-----
From: Trevor Nicholls [mailto:trevor(_at_)castingthevoid(_dot_)com] 
Sent: April 19, 2007 10:51 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Constructing a tree from leaf nodes (knowing the tree
structure)?

As I understand it (sorry if this duplicates other posts submitted
meantime):

There is a structure tree and a data tree.
The structure tree is fixed and complete.
The data tree is variable and may contain any element which corresponds to a
descendant-less node (leaf node) in the structure tree (at most one of each
element).

The required output is a merge of the structure tree and the data tree,
where:
 a) for any specific descendant-less (leaf) node in the structure tree:
   - if the data tree contains a matching node with @result true
     then @complete=true and @result=true
   - if the data tree contains a matching node with @result false
     then @complete=true and @result=false
   - if the data tree does not contain a matching node
     then @complete=false and @result=false

 b) for every other node in the structure tree:
   - if the data tree contains every descendant leaf node with @result true
     then @complete=true and @result=true
   - if the data tree contains every descendant leaf node but not all
results are true
     then @complete=true and @result=false
   - if the data tree does not contain every descendant leaf node
     then @complete=false and @result=false

Cheers
T

-----Original Message-----
From: Simon Shutter [mailto:simon(_at_)schemax(_dot_)com] 
Sent: Friday, 20 April 2007 5:15 p.m.
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Constructing a tree from leaf nodes (knowing the tree
structure)?

Dimitre,

I've done my best.  Perhaps someone who does understand the problem as I've
stated it and who also understands what you need to correctly and
unambiguously define the problem can help bridge the gap here.

Simon

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--