Link to home
Create AccountLog in
Avatar of mte01
mte01Flag for Lebanon

asked on

STX element with dynamic name

Hey experts,

  When you create an stx element, the general trend is to give it a hard-coded name such as:
 <stx:element  name="code" >
 
  I as trying to create an element whose name is taken dynamically from the value of a variable, i.e. like this:

 <stx:element  name="$code" > 

 But this doesn't seem to be possible, any idea if this is true?? Creating the name of the element tag dynamically would help me later when a program wants to retrieve values from the outputted file, as this would occur faster than if I have a static name and a different attribute for this name, because in the latter case I would have to do a loop over all the elements in the file....any help on dynamic tag name creation??
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of mte01

ASKER

Yes..it worked!!..Really Amazing!..Thanks for your help!
welcome

there is not too much background information available on STX,
but it helps to read a good XSLT book
(and realise you cannot use some of the non forward functionality)

cheers
Avatar of mte01

ASKER

>>but it helps to read a good XSLT book

Can you provide the name or link to a useful book?
Mastering XSLT Transformations,
Doug Tidwell
O'Reilly
is a good introductory book, that is consise and easy reading

of course you know that STX is only a subset of XSLT
so not everything will apply

cheers
Avatar of mte01

ASKER

Ahaa I see...thx for the tip!