XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Dan HurwitzSubject: A HREF Links in XML
Author: Dan Hurwitz
Date: 07 Apr 2000 10:28 AM
Does anyone know the syntax or have an example to create an [a href... link?

I have the following:
[link]
[link_text]Company A[/link_text]
[link_url]http://www.companya.com[/link_url]
[/link]

and want Company A to be a hot link to www.companya.com in the XSL output file.
I have tried but can't get past syntax errors in stylus.

Thanks,

Dan

Postnext
Dan HurwitzSubject: A HREF Links in XML
Author: Dan Hurwitz
Date: 13 Apr 2000 09:03 AM
Below are snippets of the XSL and XML files. In the output html, CNN is a hotlink to http://cnn.com but the looping for ABC does not work. Can someone please provide an example of looping that works with this example so that both CNN and ABC are links.

XSL FILE:
[xsl:template match="links"]
[br/]
[a]
[xsl:attribute name="HREF"]http://[xsl:value-of select="url"/][/xsl:attribute]
[xsl:value-of select="url_text"/]
[/a]
[br/]
[/xsl:template]



XML FILE:
[links>
[url_text]CNN[/url_text]
[url]www.cnn.com[/url]
[url_text]ABC[/url_text]
[url]www.abc.com[/url]
[/links]

Dan

Posttop
Richard GemmellSubject: A HREF Links in XML
Author: Richard Gemmell
Date: 14 Apr 2000 08:38 AM
On 4/13/00 9:03:15 AM, danh wrote:
>Below are snippets of the XSL
>and XML files. In the output
>html, CNN is a hotlink to
>http://cnn.com but the looping
>for ABC does not work.

Your XSL template matches the wrong node. (links rather than link) Use these instead:-

[xsl:template match="links"]
[xsl:apply-templates/]
[/xsl:template]

[xsl:template match="link"]
[br/]
[a]
[xsl:attribute name="HREF"]http://[xsl:value-of select="url"/][/xsl:attribute]
[xsl:value-of select="url_text"/]
[/a]
[br/]
[/xsl:template]

PS You can abbreviate the last template to:-
[xsl:template match="link"]
[br/][a HREF="{url}"][xsl:value-of select="url_text"/][/a]
[br/]
[/xsl:template]

regards,
Richard

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.