franceav Posted April 8, 2006 Share Posted April 8, 2006 hi guys, is it possible to make xml data as a hyperlink, when styled with xslthe xml data is clickable and pointed to another html page, also can i have an xmldata as an IMG url showing just image on the xml or html page instead of plain texts...it is better to use client scripting like javascript or jsp solutions without database support,thank you in advance!this is a sample page showing the STATIC xml page:http://www.frmv.com/collection.xml Link to comment Share on other sites More sharing options...
Little Goat Posted April 8, 2006 Share Posted April 8, 2006 try thisLG Link to comment Share on other sites More sharing options...
franceav Posted April 8, 2006 Author Share Posted April 8, 2006 try thisthank you very much for letting me know it's possible but i still don't know how to put all the code together and make it work this is the styling xsl codethis is the xml page with stylemy problem:where to put the needed code into right places and make all things worksample needed code from you mentioned link:1.<a target="_blank"><xsl:attribute name="href"><xsl:value-of select="link" /></xsl:attribute></a>2.<xsl:variable name="LINK" value="link"><a href="{$LINK}" target="blank"><xsl:value-of select="name" /></a> please help,thank you again!! Link to comment Share on other sites More sharing options...
boen_robot Posted April 8, 2006 Share Posted April 8, 2006 Why is it so hard for newbies to just TRY to look at the XPath expressions and adjust them properly. Oh... anyway...Replace <td><xsl:value-of select = "name"/></td> With <td><xsl:variable name="LINKS" value="links"><a href="{$LINKS}" target="blank"><xsl:value-of select="name" /></a></td> Or <td><a target="_blank"><xsl:attribute name="href"><xsl:value-of select="links" /></xsl:attribute></a></td> By the way, the name of the variable (LINKS) could also be anything you like. The reason why in example it's the same as value, but with capital letters is that it demonstrates the fact that a variable is accesed by it's name. Link to comment Share on other sites More sharing options...
franceav Posted April 8, 2006 Author Share Posted April 8, 2006 WHILE Replace<td><xsl:value-of select = "name"/></td> With <td><xsl:variable name="LINKS" value="links"><a href="{$LINKS}" target="blank"><xsl:value-of select="name" /></a></td> i get a syntax error from brower no marching <xsl:variable>.Or with <td><a target="_blank"><xsl:attribute name="href"><xsl:value-of select="links" /></xsl:attribute></a></td> problem with the xsl styled xml page it did not work as intended,not retrieving any data or linksagain this is the styling xsl code revised ==>catalog.xsland the original but now problematic xml page ==>collection.xml can you please help me to replace the relevant data in the catalog.xsl file according the collection.xml file data and make everything working,many thanks! Link to comment Share on other sites More sharing options...
boen_robot Posted April 8, 2006 Share Posted April 8, 2006 Oh, sorry. Mi mistake. I quickly copied the previous codes and fixed the XPath expressions, without noticing the other errors in both methods:In the method with variables: <td><xsl:variable name="LINKS" value="links" /><a href="{$LINKS}" target="blank"><xsl:value-of select="name" /></a></td>And in the attribute method:<td><a target="_blank"><xsl:attribute name="href"><xsl:value-of select="links" /></xsl:attribute><xsl:value-of select="name" /></a></td> Link to comment Share on other sites More sharing options...
franceav Posted April 8, 2006 Author Share Posted April 8, 2006 Boen thank you very much !!!while the page looks ugly it works perfectly:http://www.frmv.com/collection.xmlYOU DID GREAT JOB THAT I CAN'T JUST GET OVER BY SPENT A TON OF TIMES TO LEARNING OR SEARCHING,AGAIN THANK YOU VERY MUCH!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now