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

RE: Best practices

Subject: RE: Best practices
From: "CROFT, MICHAEL" <MCROFT@xxxxxxxxx>
Date: Tue, 18 Jun 2002 14:27:38 -0400
checkbox checked readonly
This is the context in which I need to use these techniques...

<xsl:choose>
	<xsl:when test="//InsClaimsAdverseClaimant[@ClaimantId2 =
$Id]/PowerLocks='Y' ">
				<input type="checkbox" checked="checked"
readonly="readonly"/>
	</xsl:when>
	<xsl:when
test="not(normalize-space(//InsClaimsAdverseClaimant[@ClaimantId2 =
$Id]/PowerLocks)) ">
				<input type="checkbox" checked=""
readonly="readonly"/>
	</xsl:when>
	<xsl:when test="//InsClaimsAdverseClaimant[@ClaimantId2 =
$Id]/PowerLocks='N' ">
				<input type="checkbox" checked=""
readonly="readonly"/>
	</xsl:when>
</xsl:choose>

The users want to see checkboxes  on the report either checked or not, based
on an elements value.  So, if the element has a value of 'Y', then I need to
display a checked checkbox.

If the value is 'N', or if it is an empty element <PowerLocks/>, or if it
not exist at all, if the parent contains no elements that have values, I
need to display an unchecked checkbox.


I used the not(normalize-space(myelement)) which seems to be what I would
want since it checks all scenarios to print an unchecked checkbox, but my
output for checkboxes does not render now.  I must not be using it
correctly???

Also, as a side note, readonly does not work here??? I cant use disabled
since the checkboxes are solid black when printed.  Some are saying to use a
.gif ???  Is there a better way?

-----Original Message-----
From: Michael Kay [mailto:michael.h.kay@xxxxxxxxxxxx]
Sent: Tuesday, June 18, 2002 1:29 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Best practices


> From a design standpoint, what is the "defacto" way to test 
> for an empty element?  

You have to be very careful what you mean by an "empty element". Which
of the following are empty?

<p/>
<p>  </p>
<p><!-- this is empty --></p>
<p><i></i></p>

p='' checks that the element exists and has an empty string-value: it
will match 1,3,4 in the above list, and 2 if xsl:strip-space is in use.
not(p/node()) checks that the element exists and has no children: it
will match item 1 in the above list.
not(normalize-space(p)) will match all the above.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender and postmaster@xxxxxxxxxx
**********************************************************************
 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.