You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Joshua Chamas <jo...@chamas.com> on 2000/08/04 10:50:49 UTC

Re: XForms & ASP

Dmitry Beransky wrote:
> ...
> recognizable tokens (as in '<'.'form').  Unfortunately, I cannot use XML or
> XSLT processing, as you recommend, because the content of the tags often is
> HTML.  This brings me to another question.  Is (would) it possible to do
> recursive recursive XML processing (similar to XSLT) with ASP?  Here's an
> example:
> 
> <html>
> <head>
>     <xform id="formID">
>        ...
>     </xform>
> </head>
> <body>
>     ...
>     <asp:form id="formID">
>         First name: <asp:input id="firstName"/>
>         Last name: <asp:input id="lastName"/>
>     </asp:form>
> </body>
> </html>
> 
> What I need to do is to process the asp:form element, transform the tag
> itself into appropriate html and then recursively process its content, so
> that I could get to the asp:input tags.
> 

If its HTML you need, you could substitute a call to 
HTML::Parser instead with a XMLSub <asp:form> to 
look for the input tags.  You could also do this
all at once at the Script_OnFlush event to parse
both the xform and form at runtime.

If you wanted just a XMLSubsMatch approach, you will have
to work backwards, because inner tags are evaluated
first as sub routines.  If you need the input data when you 
evaluate the <asp:form>, then you could try using script
globals to capture data for you, like in each input tag
you could set something in $Inputs{$id} = $data and 
then reference %Inputs in your <asp:form> ... that's
pretty backwards, and is a limitation with a pure 
XMLSubs approach to a problem like this.

Best of luck, and I am very interested in what you 
end up with.

-- Joshua