This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: combine xml files
Hi, Tom,
To make my explanation easier to understand (sorry for the misleading), I'm
going to describe my task.
Actually I'm doing the "View Marked" function after a search. The saved
searched are saved in a temporary file with the session id as the file name.
And each entry in the file is a complete path to a xml file. So, the number of
xml files saved in the temporary file can vary from 1 to 1000. After the user
click on the view marked button, I need to display the title and author
information for each xml file to the user. So, it's a
dynamic process.
For the title in each xml file, the title format for each database is slightly
different and so are others such as author. That's why we have a preference
list for titles, authors, etc because different group of people prefer
different display format for titles, authors, etc.
Yes, I need to look through each xml record since some titles appears only in
one database and some appear in more than one database. So, the <db*> tags are
different. And I need to find out the most preferred one to display from my
preferrence list.
Is that possible that in my stylesheet, I call a java function with the path to
xml record and parse the xml record in the java function and return the
preferred db for each entry? For example, <xsl:value-of
select="/xml/*[name()=dbPref:getTitleDbPref($xmlFileName)]/title" />
Will this be too slow to do?
Thanks a lot.
Ming
"Thomas B. Passin" wrote:
> [Ming]
> >
> > Thanks a lot for your help and this is really helpful. But after starting
> > thinking about the details, I found my problem is more complicate than
> I've
> > thought.
> >
> > The individual xml file is actually more complicate. We have more
> databases and
> > each record can appear in multiple databases. So, the xml file is actually
> in
> > this format:
> >
> > <xml>
> > <db1>
> > <title db=db1> title in db1 </title>
> > <authors>
> > <author db=db1> author name in db1 </author>
> > <author db=db1> author name in db1 </author>
> > </authors>
> > </db1>
> > <db2>
> > <title db=db2> title in db2 </title>
> > <authors>
> > <author db=db2> author name in db2 </author>
> > <author db=db2> author name in db2 </author>
> > </authors>
> > </db2>
> > </xml>
> >
> > And I have a preference which contains the preferred database order for
> title
> > display, author display and so on. For example, title display's database
> > preference is "db2 db1". What I need to do is to loop through the
> preferred
> > list and find the title in that database.
> >
>
> I don't understand your problem enough to make suggestions. Is there one
> xml file per work? If not, and if the title can be different in db1, db2,
> etc., how can you know which block of data applies to the same work? Do you
> want to process all the files at once with the same db preferences? Do you
> have to look across multiple xml files to find the various entries for db1,
> db2, etc. that apply to the same work?
>
> Depending on the details of your task, it may be best to make two passes
> through the files, but that remains to be seen
>
> Cheers,
>
> Tom P
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list