RE: [xsl] generate-d( ) not working

Subject: RE: [xsl] generate-d( ) not working
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 1 Jul 2003 22:45:53 +0100
> 
> I am trying to use generate-id() to create links inside my 
> output HTML:
> 
>   <xsl:template name="Link" match="//HSS">
> 	<xsl:for-each select=".">

Why are you doing this? It is a no-op. There is only one context node,
and it is already the context node, so iterating over it isn't going to
achieve much.

> 		<img src="texticon.gif"><a href="#{generate-id(HSS)}">

Your context node is an HSS element, and I suspect it does not have a
child called HSS. I imagine that you meant to write generate-id(.).

Michael Kay.

> 		<xsl:value-of select="@name" /></a><br /></img>
>     </xsl:for-each>
>   </xsl:template>
> 
>   <xsl:template match="//HSS">
>     <xsl:for-each select=".">
> 		<a name="{generate-id(HSS)}">
> 		<xsl:value-of select="@name" /><br />
> 		<xsl:value-of select="@required" /></a><br />
>     </xsl:for-each>
>   </xsl:template>
> 
> --------------------------------------------------------------
> --------------
> ---------------
> <HSC contractName="myService" startDate="Jun-23-2003">
> 	<imagePath />
> 	<HSDCT list="true" name="Inputs" required="true" >
> 		<HSS name="text" required="true" />
> 		<HSI name="integer" required="true" />
> 			<DefaultValue>false</DefaultValue>
> 		</HSI>
> 		<HSDCT name="Inputs1" required="true">
> 			<HSS name="text1" required="true" />
> 			<HSI name="integer1" required="true" />
> 			<HSDCT name="Inputs11" required="true" >
> 				<HSS name="text11" required="true"  />
> 				<HSI name="integer11" required="true" />
> 			</HSDCT>
> 		</HSDCT>
> 	</HSDCT>
> </HSC>
> --------------------------------------------------------------
> --------------
> ---------------------
> When i use the generate-id function the way i am, it puts the 
> data (@name,
> @required) right after each field. In this case, it puts the 
> data after the text and the link doesn't seem to work. I 
> would like to put this data after it has processed 
> everything. Is it possible?
> 
> Appreciate any hints or help in this regard.
> 
> Thank you,
> 
> John
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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


Current Thread