jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: XML aggregation
Date Tue, 17 Jul 2001 15:45:44 GMT
Hi John

From: "Morrison, John" <John.Morrison@uk.experian.com>
> I'm trying to aggregate two pieces of xml prior to applying a xsl
> transformation to the results but all the combinations I've tried have
> to naught.  Could somebody please tell me if
> 1) its possible ;)

Yes :-)

> and 2) how
> to do it!.

There's a few different ways.

In XSLT you can use the document() function to load other documents.


Or, if the 2 documents are static and do not have the <?xml version="1.0"?>
declarations then you could do this

<xsl:apply xsl="/WEB-INF/stylesheets/sample.xsl">
<io:request url="one.xml"/>
<io:request url="two.xml"/>

If you have the documents locally as files you could just do this

<xsl:apply xsl="/WEB-INF/stylesheets/sample.xsl">
<%@include file="one.xml" %>
<%@include file="two.xml" %>

Hopefully in a few days time you'll be able to do things like the following
in XTags (when some new code developed by James Elson is incorporated):-

<!-- create the composite document -->

<!-- append child documents to root element -->
<xtags:forEach select="/aggregated">
        <io:request url="one.xml"/>

        <io:request url="two.xml"/>

<!-- now style the composite document -->
<xtags:style xsl="/WEB-INF/stylesheets/sample.xsl"/>


Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

View raw message