Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 27th, 2006, 10:45 PM
Oleg.Ogurok@gmail.com
Guest
 
Posts: n/a
Default Get attribute value by its string name

Hi there,

In an XSLT stylesheet, I need to get a value of an attribute. The
problem is that I need to generate the name of the attribute on the
fly.
Is it possible to get the value of an attribute knowing its string
represented name?


E.g.


<xsl:attribute name="name">
<xsl:value-of select="concat($FieldPrefix, 'Name')"/>
</xsl:attribute>


The result is the concatenated string, e.g.
<pwm_regardingrulesetid name="MyGivenPrefixName" ...


However, MyGivenPrefixName is an attribute name in the source XML file,

and I need to get its value instead.


I tried the following, which didn't work
<xsl:value-of select="@(concat($FieldPrefix, 'Name'))"/>


Thanks,
-Oleg.

  #2  
Old July 27th, 2006, 10:55 PM
Richard Tobin
Guest
 
Posts: n/a
Default Re: Get attribute value by its string name

In article <1154037016.570170.159840@m73g2000cwd.googlegroups .com>,
<Oleg.Ogurok@gmail.comwrote:
Quote:
>I tried the following, which didn't work
<xsl:value-of select="@(concat($FieldPrefix, 'Name'))"/>
You can't do that; but you can do something like

select="@*[name() = concat($FieldPrefix, 'Name')]"

-- Richard


 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles