Loading ...
Sorry, an error occurred while loading the content.

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

Expand Messages
  • Christopher Brown
    Hi all, I want to use the XML/XSLT function to create a custom tag that will extend the functionality of the tag. What I want to do is have a tag
    Message 1 of 2 , May 29, 2002
    • 0 Attachment
      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.
       
    • Joshua Chamas
      ... You could do: SELECT {column} % FROM table The content in an XMLSubs tag is
      Message 2 of 2 , May 29, 2002
      • 0 Attachment
        > 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@...
        For additional commands, e-mail: asp-help@...
      Your message has been successfully submitted and would be delivered to recipients shortly.