• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic