Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2010, 01:35 PM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Question If statement on name object

Good day, i need help.I Don't know xslt.

I would like to put an if condition on the name object but don't know the syntax.
I successfully used it within a onClick button but can't get it on the IF

Code:
<xsl:iftest="$cTrigger='1'">
<xsl:for-eachselect="Activity/ObjectGroup[@type='trigger']/Object">

<xsl:elementname="asp:CheckBox">
<xsl:attributename='id'>
<xsl:value-ofselect='@name' />
</xsl:element>
</xsl:for-each>

<xsl:iftest="Name = 'VE10999Done'">
<!--<xsl:ifselect='@name' = 'VE10999Done' />-->
<a></a>
</xsl:if>
<xsl:for-eachselect="Activity/ObjectGroup[@type='trigger']/Object">
<input id="{Description}" type="button" value="{Description}" onClick="{@name}.click
 
Old January 18th, 2010, 01:49 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You're not explaining yourself very clearly. By "the *name* object", do you mean the value of an attribute called "name"? If so, you want

<xsl:if test="@name = 'value'">
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old January 18th, 2010, 02:06 PM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Question

Thank you, you are correct with what i want

But i tried & still unsuccessful

Code:
<xsl:if test="@name = 'VE10999Done'">
<input>...
</xsl:if>
 
Old January 18th, 2010, 03:04 PM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Question

Any ideas ? :(
 
Old January 18th, 2010, 04:51 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Please post a small but complete source document and stylesheet. Indicate the output that you were expecting and the output that you got. Then we have some hope of telling you what you did wrong. With no information about how it failed, and only a tiny fragment of your source code, we can't possibly debug it for you.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old January 19th, 2010, 04:53 AM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Wink

Apologies, i inserted the code at the incorrect location

Thank You - it had to be within the xsl:for-each

Code:
<xsl:for-eachselect="Activity/ObjectGroup[@type='trigger']/Object">
<xsl:iftest="@name = 'VE10999Done'">
<a></a>
</xsl:if>






Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap 13 pg448: Object reference not set to an instance of an object tomche BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 15 August 8th, 2009 06:14 AM
Serializing Object Graph - Assigning Object to Jag venkat.kl C# 0 August 28th, 2006 10:39 AM
OLE Object based on If statement lryckman Access VBA 3 October 25th, 2005 02:40 PM
create a Line object ,Box object in CR at Runtime? thanhnt Pro VB 6 1 May 16th, 2005 06:51 AM
Error Occurred creating Report Object: Object does sa_moizatyahoo Classic ASP Professional 0 February 1st, 2005 10:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.