Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to control the html layout according to the input data within XSL

 
Porky Liu
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose you get the xml file as this:
<Company1>
<Section11>
...
<Section12>
<Company2>
<Section21>
...
<Section22>
...


How to transfer it into HTML, with two tables with equal section number, such as this

Company1 Company2
. Section11 . Section22
. Section12 Company3
Company2 . Section31
. Section21 . Section32

If simply go straight with xsl:if, it got the trouble with well-form

So any idea to deal with such issue?
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Porky,
Could you please post your full xml structure using UBB tags [ code ] [/ code ], You can see UBB code buttons just below the Add reply button and post your code.

Also don't post the complete xml data, just post its structure in full form, which might help other folks to have a look and may help you.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Balaji Loganathan:
Also don't post the complete xml data, just post its structure in full form, which might help other folks to have a look and may help you.

Yep, it's definitely nicer to look at two sample "records" instead of browsing through hundreds of them, which are next to identical to each other anyway...
 
Porky Liu
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, thanks for you guys suggestion

I would like to clear the issue here.

The xml waiting for transform is like this:



Now I want to transform a file like this to a html with a table. The table has two columns, and each one embodies the equal number's manager.

The target html page would like this:



You see, each column has a list with four managers. if possible, we are expected to split the section, and show it on two column just like the example above.

Actually, I have got a reasonable idea today.
First I would count the number of manager totally,here it's 8(So the issue coming, how to calculate it? I have tried to use position(), last(), count(), and it seems all these function is calculated based on the special context, in other way, how to calculate the node's number in golbal?)

then loop it

The xsl file I hold currently is:



Any suggest?

[ July 07, 2004: Message edited by: Porky Liu ]
[ July 07, 2004: Message edited by: Porky Liu ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic