|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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&B=2&C=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? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Hello,
> <link>www.domain.com/index.php?A=1&B=2&C=3</link> XML requires "&" to be encoded this way: <link>www.domain.com/index.php?A=1&B=2&C=3</link> HTH Best regards, Denis Gerasimov |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Changing & to & (and = to =)...
<link>www.domain.com/index.php?A=1&B=2&C=3</link> results in: <a href="http://www.domain.com/index.php?A=1">LINK</a> <a href="http://&">LINK</a> <a href="http://B=2">LINK</a> <a href="http://&">LINK</a> <a href="http://C=3">LINK</a> On 1/9/06, Denis Gerasimov <denis.gerasimov@team-force.org> wrote: > Hello, > > > <link>www.domain.com/index.php?A=1&B=2&C=3</link> > > XML requires "&" to be encoded this way: > > <link>www.domain.com/index.php?A=1&B=2&C=3</link> > > HTH > > Best regards, > Denis Gerasimov > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Mon, Jan 09, 2006 at 10:17:58AM -0500, Tony wrote:
> Changing & to & (and = to =)... > > <link>www.domain.com/index.php?A=1&B=2&C=3</link> > > results in: > > <a href="http://www.domain.com/index.php?A=1">LINK</a> > <a href="http://&">LINK</a> > <a href="http://B=2">LINK</a> > <a href="http://&">LINK</a> > <a href="http://C=3">LINK</a> your business code is broken then, or maybe your xml parser. this has hardly anything to do with smarty. if you didn't write the code that parses your "<link>"-tag then ask the developer who did it. > On 1/9/06, Denis Gerasimov <denis.gerasimov@team-force.org> wrote: > > Hello, > > > > > <link>www.domain.com/index.php?A=1&B=2&C=3</link> > > > > XML requires "&" to be encoded this way: > > > > <link>www.domain.com/index.php?A=1&B=2&C=3</link> > > > > HTH > > > > Best regards, > > Denis Gerasimov > > > > -- > > Smarty General Mailing List (http://smarty.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php |
|
![]() |
| Outils de la discussion | |
|
|