Problem with XSL loop - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Problem with XSL loop

Hi,
I've not been working with XML/XSL for long and I've hit a snag. I'm trying to fill out a table with info from my XML. Usually, I'd use 'xsl:for-each', but on this occasion I can't. Here is the XML:






Brian
28
Red
Pizza


Steven
42
Cerise
Baby poo


Raymond
2
Blue
Fish guts


Tam
35
Green
Beef crisps






And here is the XSL transform I have so far:


<?xml version="1.0"?>















Name Age Colour Smell Select










Tick here to select










Any help would be greatly appreciated. Thanks in advance

Hellza

Comments

  • infidelinfidel Posts: 2,900Member
    : Hi,
    : I've not been working with XML/XSL for long and I've hit a snag. I'm trying to fill out a table with info from my XML. Usually, I'd use 'xsl:for-each', but on this occasion I can't. Here is the XML:
    :
    :
    :
    :
    :
    :
    : Brian
    : 28
    : Red
    : Pizza
    :
    :
    : Steven
    : 42
    : Cerise
    : Baby poo
    :
    :
    : Raymond
    : 2
    : Blue
    : Fish guts
    :
    :
    : Tam
    : 35
    : Green
    : Beef crisps
    :
    :
    :
    :
    :
    :
    : And here is the XSL transform I have so far:
    :
    :
    : <?xml version="1.0"?>
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    NameAgeColourSmellSelect
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    : Tick here to select
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    : Any help would be greatly appreciated. Thanks in advance

    What is the problem and why can't you use an xsl:for-each?


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

  • hellsgatehellsgate Posts: 3Member
    Thanks for replying Infidel,

    I couldn't use xsl:for-each as the table I was building was inside a template. However, I've managed to get it running ok now, so once again, thanks for taking the time to have a look at the problem in the first place.

    Hellsgate
  • infidelinfidel Posts: 2,900Member
    : Thanks for replying Infidel,
    :
    : I couldn't use xsl:for-each as the table I was building was inside a template. However, I've managed to get it running ok now, so once again, thanks for taking the time to have a look at the problem in the first place.

    I don't understand why xsl:for-each wouldn't work for you, but if it's working now then that's what counts.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

Sign In or Register to comment.