Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT newbee question

Status
Not open for further replies.

tyris

Programmer
Nov 2, 2000
311
FR
hi all,
i do have a xml made this way :

Code:
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<!DOCTYPE results SYSTEM &quot;test.dtd&quot;>
<?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;search.xsl&quot;?>
<results dbname=&quot;Sales &amp; Marketings&quot;>
	<searchview name=&quot;AllDocs&quot;>
		<result>
			<url>[URL unfurl="true"]http://etc</url>[/URL]
			<icon>4</icon>
			<icon>5</icon>
			<description>abcdef</description>
		</result>
		<result>
			<url>[URL unfurl="true"]http://etc</url>[/URL]
			<description>jaehdeg</description>
		</result>
		<result>
			<url>[URL unfurl="true"]http://etc</url>[/URL]
			<icon>5</icon>
			<description>adhthsdgz</description>
		</result>		
	</searchview>
</results>

i'd like in my xsl to do this :
create in the page a <a href=&quot;......&quot;> with the value that is in the <url> tag.

i tryed this :
&lt;<a href='<xsl:value-of select=&quot;link&quot;/>' &gt;
thet problem is that it displays me the code line in the page in stead of creating a link
and if i put :

<a href='<xsl:value-of select=&quot;icon&quot;/>' >
directly it tells me file not well formed.
what can i do ?

Best regards X-),
Elise
 
oups i seams that my speacila char have been transformed by the site

i put them again :
in the first case i was using html special char (& l t ;)
aand in the second, the real one (<) Best regards X-),
Elise
 
i think there's a proper way to put it in like how you tried. i currently always use..

<a><xsl:attribute name=&quot;href&quot;>search.html?venue=<xsl:value-of select=&quot;@id&quot;/></xsl:attribute>

...

</a>

in this case i created the href to be equal to search.html with the added form entry. so in my output my the href looks like

search.html?venue=London
 
great thanks
i've also found this :

<a href=&quot;{link}&quot;>
<xsl:value-of select=&quot;description&quot;/>
</a>

very simple
can you help me now for an image ? something like <img src=&quot;/pics/<xsl:value-of select=&quot;icon&quot;/>.gif&quot;...
but i don't know how to finish the img tag
Best regards X-),
Elise
 
because in fact icon i just a number, part of an image file name :

<img src=&quot;C:\Documents and Settings\ed\My Documents\My Pictures\vwicn{icon}.gif&quot;/>

i tryed something like this
but it returns me :

<IMG
src=&quot;C:\Documents and Settings\edupont\My Documents\My Pictures\vwicn.gif&quot;> (doesn't put the icon value ) Best regards X-),
Elise
 
i must maybe explain more :
for each result i may have between 0 and 2 images.

i made this :
<xsl:for-each select=&quot;icon&quot;>
<td>
<img src=&quot;vwicn{icon}.gif&quot;/>
</td>
</xsl:for-each>

is the problem because i'm already in the icon node ?
what can i do to tell :
for each times you see an icon tag, create a new image.

Best regards X-),
Elise
 
i've found ! it's the &quot;.&quot;
sorry to have posted so many tingsd for nothing
Best regards X-),
Elise
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top