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 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
fsda fdasSubject: Trying to insert XML data into hyperlink multiple times per link
Author: fsda fdas
Date: 30 May 2006 03:04 PM
Originally Posted: 30 May 2006 02:59 PM
Hey everyone,

I have been trying to figure this out all day to no avail. I am trying to insert XML data into a hyperlink in two locations. For instance I need the URL to look like this:

/catalog/product/index.cgi?catalog_number=<INSERT XML DATA HERE>&inE=1&highlight=<INSERT XML DATA HERE>


<xsl:variable name="prod">
<xsl:value-of select="Prod_No" />
</xsl:variable>
<a href="/catalog/product/index.cgi?catalog_number={$prod}">
<xsl:value-of select="Prod_No" />

Using the code above I can add the attribute prod multiple times until I get to the &inE=1&highlight= part of the hyperlink. I think the & is causing a problem. Any suggestions on how to make the code below work???

<xsl:variable name="prod">
<xsl:value-of select="Prod_No" />
</xsl:variable>
<a href="/catalog/product/index.cgi?catalog_number={$prod}&inE=1&highlight={$prod}">
<xsl:value-of select="Prod_No" />

THANKS!!!

Postnext
Ivan PedruzziSubject: Trying to insert XML data into hyperlink multiple times per link
Author: Ivan Pedruzzi
Date: 30 May 2006 03:13 PM

& is a reserved character in XML you have to escape it using a XML entity; replace & with &amp;


Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Posttop
fsda fdasSubject: Trying to insert XML data into hyperlink multiple times per link
Author: fsda fdas
Date: 30 May 2006 03:35 PM
Solved the issue using the following code and calling the variable {amp} whenever needed:

<xsl:variable name="amp">&amp;</xsl:variable>

 
Topic Page 1 2 3 4 5 6 7 8 9 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.