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

RE: Start and end an anchor tag in 2 different if's?

Subject: RE: Start and end an anchor tag in 2 different if's?
From: Pieter Reint Siegers Kort <pieter.siegers@xxxxxxxxxxx>
Date: Tue, 5 Oct 2004 11:11:23 -0500
anchor tag in xsl
Hi Hardy,

Straight answer is no. Why? Because you are using xslt that is not
well-formed - it should close the <a> element before the <xsl:if>.

You need a different approach here.

HTH,
<prs/>

-----Original Message-----
From: Hardy Merrill [mailto:HMerrill@xxxxxxxxxxxxxxxx] 
Sent: Tuesday, October 05, 2004 10:51 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Start and end an anchor tag in 2 different if's?

Given this snippet from an XSL style sheet:
----------------------------------------------------------

	<xsl:if test="district_active='1'">
		<a>
			<xsl:attribute name="href">LegislatorEdit.asp
				?lid=<xsl:value-of
select="legislator_id" />
				&amp;lstat=<xsl:value-of select="$lstat"
/>
				&amp;dtype=<xsl:value-of select="$dtype"
/>
				&amp;dno=<xsl:value-of select="$dno" />
			</xsl:attribute>
	</xsl:if>
				
	<xsl:choose>
		<xsl:when test="substring(full_name,1,6) = 'Vacant'">
			<xsl:value-of select="'Vacant'" />
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="full_name" />
		</xsl:otherwise>
	</xsl:choose>
						
	<xsl:if test="district_active='1'">
		</a>   <!--============ Notice this ==============-->
	</xsl:if>

------------------------------------------------------------------------

Can't the first if-test start an <A> tag, and the 2nd if-test end it with
</A>?  I want to start the anchor, then fill in the display text based on a
choose, and then end the anchor.

When I try this I get this error

msxml4.dll error '80004005' 
The stylesheet does not contain a document element. The stylesheet may be
empty, or it may not be a well-formed XML document. 

Is there something obvious that I'm doing wrong?

TIA.

Hardy Merrill

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.