xsl-list
[Top] [All Lists]

Controlling tabular layout of a nodeset

2003-07-25 02:55:02
I am using Xalan-j_2_5_1. I have a set of elements (recovered by SQL), each 
containing four child elements: property, prvalue, user_id and acct_id. I can 
use the Muench method to obtain a nodeset containing all elements with a 
particular value of "property". I can sort this into the required order. Using 
a for-each loop I can display this in a table as:

+---------+--------+--------+--------+
|property1|prvalue1|user_id1|acct_id1|
+---------+--------+--------+--------+
|property1|prvalue1|user_id1|acct_id2|
+---------+--------+--------+--------+
|property1|prvalue1|user_id2|acct_id1|
+---------+--------+--------+--------+

I want to display it as:
+--------+------------------+
|property1 - prvalue1       |
+--------+------------------+
|user_id1|acct_id1, acct_id2|
+--------+------------------+
|user_id2|acct_id1 ...      |
+--------+------------------+

In order to do this I need to either access the element in my nodeset before 
"." or store the values of prvalue and user_id from one iteration to access in 
the next iteration, to do the appropriate format control.

I can get the result I need by successively searching the source tree, but the 
length of this table makes this unacceptably slow (4 1/2 hours).

I had hoped that EXSLT set:leading() would provide a solution, but I note that 
the documentation shows this returns a node set in document order, not in the 
order of the sorted subset I have obtained, so I have not pursued this.

This seems such a common requirement that I am sure there is a straightforward 
answer and I apologise if I have missed it.

Thank you.

John Marshall
Accurate Software

80 Peach Street, Wokingham, Berkshire, RG40 1XH, UK.
Tel: +44 (0)118 977 3889
Fax: +44 (0)118 977 1260
http://www.accuratesoftware.com 


Accurate Software

info(_at_)accuratesoftware(_dot_)com
www.accuratesoftware.com

Europe . North America . Australasia . Africa

The information in this email is confidential and privileged and is intended 
only for the use of the individual or entity listed above.  If you are neither 
the intended individual, or entity listed above, nor the person responsible for 
the delivery of this email to the intended recipients, you are hereby notified 
that any unauthorised distribution, copying or use of this email is prohibited. 
If you have received this email in error, please notify the Accurate system 
manager at postmaster(_at_)accuratesoftware(_dot_)com or on +44 (0)118 977 
3889.  The views expressed in this communication may not necessarily be the 
views held by the Accurate Group.


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



<Prev in Thread] Current Thread [Next in Thread>