0

I am trying to add two parameters into a web link which is "userid" and "location" with XML. Here is my code below:

             <xsl:sort order="ascending" select="user_id"/>
             <tr>

             <xsl:variable name="index" select="user_id" />

                <xsl:apply-templates select="username"/>
                <xsl:apply-templates select="type"/>
                <xsl:apply-templates select="location"/>
                <xsl:apply-templates select="price"/>

                <td><a href="moreinfo.php?userid={$index}&location=lewisham">Click here</a></td>

However, it only lets me use one parameter and the other causes following errors. No matter which way I try, either one of the parameters works until I add both to the link.

Warning: DOMDocument::load(): EntityRef: expecting ';' in /home/cb222/public_nginx/level5/XSL.xsl, line: 49 in /home/cb222/public_nginx/level5/rest_sbt.php on line 31

Warning: XSLTProcessor::importStylesheet(): compilation error in /home/cb222/public_nginx/level5/rest_sbt.php on line 32

Warning: XSLTProcessor::importStylesheet(): xsltParseStylesheetProcess : empty stylesheet in /home/cb222/public_nginx/level5/rest_sbt.php on line 32

Warning: XSLTProcessor::transformToXml(): No stylesheet associated to this object in /home/cb222/public_nginx/level5/rest_sbt.php on line 34

What am I doing wrong?

  • I found this post would help: [Cannot get xslt to output an (&) even after escaping the character][1] [1]: http://stackoverflow.com/questions/67859/cannot-get-xslt-to-output-an-even-after-escaping-the-character – C.B. Mar 15 '15 at 16:06
  • Thanks. The answer is that XML cannot parse '&' and so I had to use '&' instead. – Thug_Life_Imti Mar 15 '15 at 16:22

0 Answers0