Subject: RE: [xsl] New to XML - probably not yet worthy of your time. From: "Piers Haken" <piersh@xxxxxxxxxxx> Date: Fri, 6 Jul 2001 05:00:20 -0700 |
This is definitely a FAQ, but anyway... You don't need the script to write the attributes there's two ways of doing it: Here's what you did: <script> cursrc = '<xsl:value-of select="info/link"/>' document.write ('<a href="'+cursrc+'">Relevant Site</a>') </script> Here's one way, using <xsl:attribute/> : <a>Relevant Site<xsl:attribute name="href"> <xsl:value-of select="info/link"/> </xsl:attribute></a> Here's another, using attribte templates (it's the same thing really, just a shortcut): <a href="{info/link}">Relevant Site</a> Also, I'd recommend using a template instead of xsl:for-each. Hope that helps. Piers Haken Chief Software Engineer, Friskit Inc. http://www.friskit.com/?m&209701&44&m -----Original Message----- From: Reuben Bell [mailto:Reuben.Bell@xxxxxxxxxxxxxxxx] Sent: Wednesday, July 04, 2001 4:08 AM To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx' Subject: [xsl] New to XML - probably not yet worthy of your time. as a web developer, who is begining to learn xml, I was wondering it anyone could help me with the following little problem,. My code -> <xsl:for-each select="gallery/pic"> <tr> <td colspan="2"><b><xsl:value-of select="info/title"/></b></td> </tr> <tr> <td colspan="2"> <script> cursrc = '<xsl:value-of select="info/link"/>' document.write ('<a href="'+cursrc+'">Relevant Site</a>') </script> </td> </tr> <tr> <td><script> cursrc = '<xsl:value-of select="image/src"/>' //alert (cursrc) truecursrc = "gfx/" + cursrc document.write ('<IMG width="386" SRC="'+truecursrc+'"/>') </script></td> <td valign="top" class="blacknormtext"><xsl:value-of select="info/description"/></td> </tr> </xsl:for-each> as you can see.,.. this xsl doc quite frankly sucks... I would like to just put the value into the src somehow but dont know how. thanks for any help, also... what is the USE of XML? and what (in your opinion) is the best Server Side release of it (i heard someone mention 'cocanut' or something - it was late)? Thanks so much, Reuben Bell, Web Developer Rufus Leonard 57a Farringdon RD London WC12 1ED -----Original Message----- From: David Carlisle [mailto:davidc@xxxxxxxxx] Sent: Wednesday, July 04, 2001 11:56 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] RE: A simple solution (Was: Re: One for tomorrow :-) ) I'm using <xsl:value-of select="following-sibling::*[not(substring(.,string-length(.))=',')][pos itio n()=4]" /> To hopefully retrieve 12 POINT STREET, [position()=4] (or equivalently [4]) would select the 4th node that was in the list generated by following-sibling::*[not(substring(.,string-length(.))=',')] ie the 4th sibling (just counting those not ending with a comma) (by the way are you sure you really want to polute your generated HTML with all those <font> elements, they are deprecated in HTML4 and XHTML) David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list ************************************************************************ **** This email transmission is confidential and intended for the addressee only. If you are not the intended recipient, please notify Rufus Leonard IT Support by telephoning +44 (0)20 7404 4490 before deleting this message from your computer. The views and opinions expressed in this email message are the author's own and may not reflect the views and opinions of Rufus Leonard. ************************************************************************ **** 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] New to XML - probably not, Dominic J. Blythe | Thread | [xsl] XSL-FO, roger . day |
Re: [xsl] XSLT implementation, Peter Flynn | Date | RE: [xsl] Encoding iso-8859-1 alway, Piers Haken |
Month |