You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Jarrod Stenberg <sl...@yahoo.com> on 2002/11/06 15:47:19 UTC
Multiple xml inputfiles?
In JSP you can do this:
<xsl:apply xsl="/xsl/programcalendar_xml.xsl">
<programdata>
<%= ServletCaller.get("getcalendarXML",props)
%>
<%= ServletCaller.get("getprogram",props) %>
</programdata>
</xsl:apply>
So the xsl can chew on both xml documents that are
returned. This is EXTREMELY handy for effectively
joining data within the XSL. It prevents redundancy.
It promotes portability of servlets and the servlet's
xml output in my case. It's fantastic to have as an
option.
Is this possible in Embperl?
I mean how would you do it with the "Execute" command:
Execute ({inputfile => 'my.xml', recipe => 'LibXSLT',
xsltstylesheet => 'posts.xsl'})
?
I really need to do this in order to make a current
program work in the best way I know. For example:
<programdata>
<post><subject>test</subject><id>12</id></post>
<thread>
<id>11<id>12</id></id>
</thread>
</programdata>
The xsl gets to work on both <post> and <thread>. So
you can do things like flag where in the thread the
post belongs within the xsl. For example:
<xsl:if select="@id=$active_id">you are
here-></xsl:if>
-Jarrod
__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Multiple xml inputfiles?
Posted by Jarrod Stenberg <sl...@yahoo.com>.
> > In JSP you can do this:
> > <xsl:apply
> xsl="/xsl/programcalendar_xml.xsl">
> > <programdata>
> > <%=
> ServletCaller.get("getcalendarXML",props)
> > %>
> > <%= ServletCaller.get("getprogram",props)
> %>
> > </programdata>
> > </xsl:apply>
> >
>
> Execute ({inputfile => 'my.xml', recipe =>
> 'EmbperlLibXSLT',
> xsltstylesheet => 'posts.xsl'})
>
> and my.xml contains
>
> <programdata>
> [- Execute ("getcalendarXML") -]
> [- Execute ("getprogram") -]
> </programdata>
>
>
Thanks. I'll try that. Since I wrote the email, I
found the XPath document() function which might also
accomplish what I'm after.
-Jarrod
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Multiple xml inputfiles?
Posted by Gerald Richter <ri...@ecos.de>.
> In JSP you can do this:
> <xsl:apply xsl="/xsl/programcalendar_xml.xsl">
> <programdata>
> <%= ServletCaller.get("getcalendarXML",props)
> %>
> <%= ServletCaller.get("getprogram",props) %>
> </programdata>
> </xsl:apply>
>
Do
Execute ({inputfile => 'my.xml', recipe => 'EmbperlLibXSLT',
xsltstylesheet => 'posts.xsl'})
and my.xml contains
<programdata>
[- Execute ("getcalendarXML") -]
[- Execute ("getprogram") -]
</programdata>
if the xmls files doesn't contain any Embperl command you may want to change
the Execute calls to
[- Execute ({inputfile => "getcalendarXML", syntax => 'Text'}) -]
to avoid missinterpretation of the content
Hope this helps
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org