• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[XSL][XPath] Retrieve attribute by its name

 
Chris Baron
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have the strange but unavoidable task to build table-rows from columns.
Because no sort order can be garanteed, i'd like to retrieve attributes by their names.
I tried x variations but none worked. Can someone help me with it?

I have a loop for each row at the moment but i'd prefer to do it in a named template.
Thanks in advance
cb
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't tried it out, but all I think you need to do is change name to name() in line 18.

name
gives you the value of sub-elements called 'name' (which don't exist). name() gives you the name of the current node, which is what you want.
 
Chris Baron
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works. Cool, thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic