p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

xslt thread: FW: creating indexes from multiple input documents


Message #1 by "Masters, Chris (RBI - AUS)" <Chris.Masters@r...> on Fri, 14 Jun 2002 10:09:16 +1000
There are two tasks here: getting data from all the related documents,
and inverting the client/agent structure. It's not clear from your
description which of these tasks is the one you're having difficulty
with.

The inversion of client/agent depends very much on whether it is a 1:n
or m:n relationship, which also isn't clear from your posting. In other
words, is there a need to eliminate duplicates? Unfortunately the
standard techniques for grouping and eliminating duplicates do not work
well across multiple documents, so you may need to assemble all the
documents into one as the first phase of your transformation - unless
you are prepared to consider using the xsl:for-each-group capability in
the draft XSLT 2.0 (available in Saxon 7.1).

Michael Kay
Software AG
home: Michael.H.Kay@n...
work: Michael.Kay@s... 

> -----Original Message-----
> From: Masters, Chris (RBI - AUS) 
> [mailto:Chris.Masters@r...] 
> Sent: 14 June 2002 01:09
> To: P2P_XSLT
> Subject: [xslt] FW: creating indexes from multiple input documents
> 
> 
> 
> Im working on a directory publication that has hundreds of 
> xml instances. The directory is in a heirarchy structure.  
> EG.
> <publication>
> <pubcat pubcatid="1000" level="1">
>   <pubcat pubcatid="1100" level="2"/>
>   <pubcat pubcatid="1200" level="2">
>     <pubcat pubcatid="1210" level="3">
>     <pubcat pubcatid="1220" level="3">
>   </pubcat>
>   <pubcat pubcatid="1300" level="2"/>
> </pubcat>
> <pubcat pubcatid="2000" level="1">
>   <pubcat pubcatid="2100" level="2"/>
>   <pubcat pubcatid="2200" level="2"/>
> </pubcat>
> <pubcat pubcatid="3000" level="1">
>   <pubcat pubcatid="3100" level="2"/>
> </publication>
> 
> Now each of the nodes (except the rootnode of course) 
> corresponds to an xml instance file.  Which has something like
> 
> <agent.grp>
> <agent>
> <AgentName>007</AgentName>
> <client.grp>
> <client>aaaa</client>
> <client>xxxx</client>
> </client.grp>
> </agent>
> <agent>
> <AgentName>R2D2</AgentName>
> <client.grp>
> <client>bbbbb</client>
> <client>cccc</client>
> </client.grp>
> </agent>
> </agent.grp>
> 
> What I need to output is:
> * a alphabetical order of all clients, and agents in a text file
> 
> Sample is
> Client: aaaaa
>   Agent: 007
> Client: bbbbb
>   Agent: R2D2
> Client: cccc
>   Agent: R2D2
> Client: xxxx
>   Agent: 007
> 
> 
> Any Ideas on how to accomplish this.....
> 
> Thanks In Advance
> 
> Dax Menardo
> 
> 


  Return to Index