[SMARTY] Problem parsing xml link with _GET parameters.

Tony <[email protected]>
Newsgroups gmane.comp.php.smarty.general
Message-ID <[email protected]>
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?

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.