aspose file tools*
The moose likes XML and Related Technologies and the fly likes [XSL][XPath] Retrieve attribute by its name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "[XSL][XPath] Retrieve attribute by its name" Watch "[XSL][XPath] Retrieve attribute by its name" New topic
Author

[XSL][XPath] Retrieve attribute by its name

Chris Baron
Ranch Hand

Joined: Mar 21, 2003
Posts: 1049
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

Joined: Apr 06, 2010
Posts: 4363
    
    8

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

Joined: Mar 21, 2003
Posts: 1049
Works. Cool, thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [XSL][XPath] Retrieve attribute by its name