473,672 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:attribut e name="name">
<xsl:value-of select="concat( $FieldPrefix, 'Name')"/>
</xsl:attribute>
The result is the concatenated string, e.g.
<pwm_regardingr ulesetid name="MyGivenPr efixName" ...
However, MyGivenPrefixNa me 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="@(conca t($FieldPrefix, 'Name'))"/>
Thanks,
-Oleg.

Jul 27 '06 #1
1 1253
In article <11************ **********@m73g 2000cwd.googleg roups.com>,
<Ol*********@gm ail.comwrote:
>I tried the following, which didn't work
<xsl:value-of select="@(conca t($FieldPrefix, 'Name'))"/>
You can't do that; but you can do something like

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

-- Richard
Jul 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2932
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've some namespace problems when defining default values for attributes. My problem seems to come from the fact that the attributes are defined in a different namespace from the element.
4
2519
by: smita | last post by:
Hi, I have an xml file as below <root> <table id =1> <user>abc</user> <age>25</age> </table> <table id = 2> <user>xyz</user>
2
6699
by: Ian Griffiths | last post by:
I have been given a schema, instances of which I'm required to be able to consume and generate. I'd like to be able to manipulate these instances as DataSets internally in my application. The schema defines the following simpleType: <xs:simpleType name="cs"> <xs:restriction base="xs:token"> <xs:pattern value="*"/> </xs:restriction> </xs:simpleType>
4
1669
by: trexim | last post by:
It seems that .NET does not support xsd:extension and xsd:attribute. What is the alternative? Thanks,
12
4944
by: Stefano | last post by:
Hi all, what is the correct use of the "default" attribute in XML Schema? For example: <xs:element name="myProperty" type="xs:string" default="myDefaultValue"/> What can I do with it? What is the meaning of < ....default="myDefaultValue" /> ?
3
2201
by: Anders Jansson | last post by:
Hi all. I have 2 problems when I try to open and convert an ASP.NET VS 2003 web-applikation in VS 2005. In VS 2003 I have no problems at all! First: One subfolder with will not be converted! The converted web project are missing this subfolder completely. 39 errors are displayed in the Conversion Report saying: ERROR: Unable to get local copy of file <file>. Why? All files are there and readable!!
3
6842
by: ThunderMusic | last post by:
Hi, I have an XML like document I want to parse... The document looks like this : <Form id="frmMain" width="345" height="75" HeaderHeight="9" image="frmMain.jpg" ColorKey="000000"> <Control id="btnTest1" image="btnTest1.jpg" ColorKey="000000" left="10" top="10" Width="10" Height="10" /> <Control id="btnTest2" image="btnTest2.jpg" hovertype="bevel" left="50" top="20" Width="10" Height="10" />
4
2702
by: Eric | last post by:
Attached is an example of my question. Note the "values" attribute is optional. Also the <valuesub-element is optional. Here, the XML can contain, 1 or both or neither. I would like to allow EITHER the "values" attribute or <valuesub-elements - but not both. I tried using a <choicewith two element definitions for "characteristic" with different content, but this is clearly not allowed in XSD. Does anyone have an answer? Thanks.
1
2311
by: naga01 | last post by:
Hi all, I have an XML in which i need to validate the attribute values based on another attribute value of the same tag. For Example <Employees xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <Emp> <Column name="EName">Albert</Column>
0
8419
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8696
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6254
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4239
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2836
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2092
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.