Philip Mak wrote:
> 
> On Sat, 8 Sep 2001, Joshua Chamas wrote:
> 
> > I'll see if I can get this to work.  But the parser is
> > pretty fast now, and it'll be a trick to get this to
> > work and keep it fast.
>
> It's not terribly important, although it would be nice to have. Right now
> I'm using a workaround:
> 
> &s::link({href=>'author.asp', query=>{action=>'view', aid=>$aid}}, $author->{name});
> 
> instead of
> 
> <s:link href="author.asp" query="<%={action=>'view', 
>aid=>$aid}%>">$author->{name}</s:link>
> 
> This is a function that I use to generate URLEncoded query strings for me;
> it would become like:
> 
> <a 
>href="author.asp?action=view&aid=<%=$Server->URLEncode(aid)%>"><%=$author->{name}%></a>
> 

Not that it gives you > in the XMLSubs args, but you 
can use $Server->URL for what you are doing to construct
a URL that is escaped like this

 <a href="<%=$Server->URL($url, \%params)%>">

You might create an XMLSub like:

 <s:link href="here.asp" query_arg1="asdf" query_arg2="asdfa" />

which calls a sub like:

sub s::link {
  my($args, $html) = @_;
  my $href = delete $args->{'href'};
  print "<a href=".$main::Server->URL($href, $args).">$html."</a>";
}

Your query string data is just all the args that aren't href.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to