[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: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 5 Oct 2004 17:05:31 +0100
xslt anchor tag
> Is there something obvious that I'm doing wrong?

yes:-)

XSLT has no access to tags in the input document and can not directly
produce tags in the result. It inputs a tree of nodes (which is
generated by parsing the tags in an xml document) and it generates a
result tree (which might, or might not, be serialised as an XML document
containing tags).

You can't have "half a node" in a tree so XSLT has no concept of having
a start tag in one place and an end tag somewhere else.

less abstractly, an XSLT file is read by an XML parser before it starts
and an xml parser knows nothing about xslt or html so

	<xsl:if test="district_active='1'">
		</a>   <!--============ Notice this ==============-->
	</xsl:if>



looks like

<zzz>
 </ccc>
</zzz>

and generates an error that the document is not well formed.


You need to move the code all inside a single test for district_active.

Also

	<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>

could be more simply written as

<a
href="LegislatorEdit.asp?lid={legislator_id}&amp;lstat={$lstat}&amp;dtype={$dtype}&amp;dno={$dno}">

(I've also removed the white space which may or may not need to be
removed, depending on whether your server accepts (and ignores) url
quoted white space between the parameters.)


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.