[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: GUI layout mechanism in XSLT
Ilya,
It's an interesting problem. At 10:14 AM 1/6/2005, you wrote: Producing <tr>s and </tr>s seems to be the most problematic issue in the whole task, because here it's necessary in many cases to start a new <tr>, while a vgroup is processed, and _not to generate the closing tag_ of this <tr> during this vgroup processing, because some of the elements, which will be processed later, are likely to be placed in the same row. This seems to be simply impossible to do in a straightforward way with XSLT. Correct, if you qualify further: "impossible to do in a straightforward way with XSLT 1.0 in a single pass". Often such tricky processes are dealt with more straightforwardly if you break the problem into two passes. A first pass performs heuristics: in your case it could count up all the relevant neighbors of each item to derive the "size" information you need for each cell. A near-identity transform could amend the input with the results of this analysis. Then a second transform could skip the analysis, simply building the output using standard grouping techniques for table-building based on the values provided by the first pass -- thus dealing with the "can't close the row yet" issue. Although grouping can be a pain in XSLT 1.0, it's well understood and documented, and disentangling it from the analytics would isolate the problem here. (After you were done you might even discover it's possible to fold the two passes back into one. I haven't given the problem enough thought to see whether that would be easy or worthwhile.) Note 2. The colspan attribute is needed just to complete a row in the output table in case if the last element of this row must be placed not in the last column of the table. But this is not that important: another possibility would be to generate empty cells at the end of the row in this case. In two passes you could do this the "clean" way. Sorry not to be able to help with the analytics themselves. I'm having to limit my advice today to pointing a possible way forward.... Cheers, Wendell
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|