Problem parsing xml link with _GET parameters.

From: Date: Sun, 08 Jan 2006 21:02:27 +0000
Subject: Problem parsing xml link with _GET parameters.
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13222@lists.php.net to get a copy of this message
I tried using the following to produce xml output like the hypothetical example... <?php echo '<link>www.domain.com/index.php?A=1&B=2&C=3</link>'; ?> but I found I had to substitute HTML character code like the following to prevent xml errors... <?php echo '<link>www.domain.com/index.php?A#61;1&#38;B&#61;2&#38;C&#61;3</link>'; ?> Once that was accomplished I then tried to parse the above xml line with Smarty. I expected something like... <a href="http://www.domain.com/index.php?A=1&B=2&C=3">LINK</a> However, when Smarty parses the file, the output is: <a href="http://www.domain.com/index.php?A">LINK</a> <a href="http://=">LINK</a> <a href="http://1">LINK</a> <a href="http://&">LINK</a> <a href="http://B">LINK</a> <a href="http://=">LINK</a> <a href="http://2">LINK</a> <a href="http://&">LINK</a> <a href="http://C">LINK</a> <a href="http://=">LINK</a> <a href="http://3">LINK</a> Smarty Parsing Functions: function startContact($parser, $name, $attribs){ global $currentTag, $currentAttribs, $contact, $page; $currentTag = $name; $currentAttribs = $attribs; switch ($name) { case "link"; $contact .= ""; break; } return $contact; } function endContact($parser, $name){ global $currentTag, $contact, $page; switch ($name) { case "link"; $contact .= ""; break; } $currentTag = ""; $currentAttribs = ""; return $contact; } function dataContact($parser, $data){ global $currentTag, $contact, $page; switch ($currentTag) { case "link"; $contact .= "<a href=\"http://".$data."\">LINK</a>"; break; } return $contact; } Has anyone experienced this problem? How should I correct for it?

« previous php.smarty.general (#13222) next »