Thanks for the hints, aggregation is the way to go for sure, but im still
facing a problem
Basicly what im looking for is how to (fastest possible way) do to a project
(relational algebra) operation on a long list of relations in xsl.
Im not sure this should be done in xsl perhaps I need a custom transformer
anyway
Let's say I have this document
<all>
<view name="economy">
<columns>
<measure name="economy_estimate"/>
<measure name="economy_actual"/>
<measure name="responsible"/>
</columns>
</view>
<projects>
<project>
<measure name="responsible"> kav </measure>
<measure name="economy_actual">991233</measure>
<measure name="economy_estimate">881123</measure>
<measure name="schedule_actual">123</measure>
<measure name="schedule_estimate">823</measure>
</project>
<project>
<measure name="responsible"> pjc </measure>
<measure name="economy_actual">77123123</measure>
<measure name="economy_estimate">44123123</measure>
<measure name="schedule_actual">723</measure>
<measure name="schedule_estimate">923</measure>
</project>
..... 100's of other projects....
</projects>
</all>
how do I transform this document into something like this:
The order between measures is as defined in the view part, ie (estimate
before actual) before responsible
<projects>
<project>
<measure name="economy_estimate">881123</measure>
<measure name="economy_actual">991233</measure>
<measure name="responsible"> kav </measure>
</project>
<project>
<measure name="economy_estimate">44123123</measure>
<measure name="economy_actual">77123123</measure>
<measure name="responsible"> pjc </measure>
</project>
</projects>
regards
Kasper
----- Original Message -----
From: "Kasper Nielsen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 05, 2002 2:27 PM
Subject: simpel cocoon question
> Just started using Cocoon and I have a rather simple question:
>
> Lets say i have a document with all my data (projects.xml)
> <projects>
> <project id="A1">
> <name> RailwayTrack DF</name>
> <responsible> kni </responsible>
> <economy_actual>123</economy_actual>
> <economy_estimate>456</economy_estimate>
> <schedule_estimate>789</economy_estimate>
> </project>
> <project id="B4">
> <name> Digital Transmission </name>
> <responsible> pjc </responsible>
> <economy_actual>987</economy_actual>
> <economy_estimate>654</economy_estimate>
> <schedule_estimate>321</economy_estimate>
> </project>
> ............
> </projects>
>
> And i also have a definition of some views of the data (views.xml)
>
> <views>
> <view name="estimate">
> <columns>
> <measure name="schedule_estimate"/>
> <measure name="economy_estimate"/>
> </columns>
> </view>
> <view name="overview">
> <columns>
> <measure name="name"/>
> <measure name="responsible"/>
> </columns>
> </view>
> </views>
>
> Now I want to given the name of the view, lets say "estimate" to combine
it
> into another xml document, that is extract only the data mentioned in the
> view, in this case it would be the "schedule_estimate" column and the
> "economy_estimate" column
> The resulting document should look something like this
> <table>
> <columndefs>
> <columndef>
> <column-name>schedule_estimate</column-name>
> </columndef>
> <columndef>
> <column-name>economy_estimate</column-name>
> </columndef>
> </columndefs>
> <tabledata>
> <row>
> <entry>456</entry>
> <entry>789</entry>
> </row>
> <row>
> <entry>654</entry>
> <entry>321</entry>
> </row>
> </tabledata>
> </table>
>
> Can I "merge" 2 documents in that way with xslt?
> Or do I need a custom transformer?
>
> regards
> Kasper Nielsen
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>