[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XPath without using variable ?

Subject: XPath without using variable ?
From: Arthur Maloney <ArthurM@xxxxxxxxxx>
Date: Sat, 3 Jul 2004 12:36:41 +0100
xpath dropdownlist
Hello xsl-list,


How do specify an attribute in XPath?
@type is an attribute of an in-context element.

I've tried this, but it does not work.
<xsl:variable name="path" select="//hungarian/identifier[@name=@type]"/>

When I Hard code e.g. identifier[@name='asp:DropDownList']   it works.
Also using a variable, as below it works.

What is XPath grammar to avoid having to use a variable?

[Code]
<xsl:for-each select="./control">

  Example of in context element, its looping through:

  <control type="asp:DropDownList">
         <name>Prefix</name>
         <description>A person's formal prefix e.g. Mr, Mrs.</description>
  </control>

  I'm use this as a lookup (my problem: trying to avoid using variable 'test')
  <xsl:variable name="test" select="@type"/>
  <xsl:variable name="path" select="//hungarian/identifier[@name=$test]"/>

The element it found i.e. assigned to $path (it is correct).
<identifier name="asp:DropDownList" prefix="ddl" suffix="DropDownList" type="DropDownList"/>




...
</xsl:for-each>

-- 
Best regards,
 Arthur                          mailto:ArthurM@xxxxxxxxxx


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.