You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Christopher Brown <ch...@cal.berkeley.edu> on 2002/05/29 20:55:34 UTC

Interpreting content/body in a XML/XSLT custom tag.

Hi all,

I want to use the XML/XSLT function to create a custom tag that will extend
the functionality of the <select> tag.  What I want to do is have a tag like
the following:

<extended:select name="some_name" size="1">
    some_sql_statement
</extended:select>

The idea is that the some_sql_statement will populate the option(s) for the
select tag.  Seems straight forward right?

I have been able to get it to work if some_sql_statement does not require
interpretation, i.e. if some_sql_statement is a literal.  I cannot get it
working if I want to include a variable or a reference in
some_sql_statement.  In other words, this works

    SELECT col_1 from table

but this does not:

    SELECT $Session->{column} FROM table

How can I interpret the content/body of a custom tag so that I can then pass
it properly to the DB interface.  I am probably missing something easy here.

Thanks in advance,

Chris.

Re: Interpreting content/body in a XML/XSLT custom tag.

Posted by Joshua Chamas <jo...@chamas.com>.
> Christopher Brown wrote:
> 
> Hi all,
> 
> I want to use the XML/XSLT function to create a custom tag that will extend the functionality of the <select> tag.  What I want to do is have a tag
> like the following:
> 
> <extended:select name="some_name" size="1">
>     some_sql_statement
> </extended:select>
> 
> The idea is that the some_sql_statement will populate the option(s) for the select tag.  Seems straight forward right?
> 
> I have been able to get it to work if some_sql_statement does not require interpretation, i.e. if some_sql_statement is a literal.  I cannot get it
> working if I want to include a variable or a reference in some_sql_statement.  In other words, this works
> 
>     SELECT col_1 from table
> 
> but this does not:
> 
>     SELECT $Session->{column} FROM table
> 

You could do:

<extended:select name="some_name" size="1">
     SELECT <%= $Session->{column} %> FROM table
</extended:select>
 
The content in an XMLSubs tag is evaluated as normal ASP
before being passed to the subroutine, so you could have 
more XMLSubs evaluated therein as well as ASP code blocks.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org