PDA

View Full Version : Multiple XML files


claire rand
02-01-2005, 09:20 AM
Having finally managed to handle storing data in an xml file, and even handling the display via xsl & css I now have another question..

Currently I'm linking to the xsl from within the xml file, is there a way to do this the other way round, i.e. have the xsl file link to the xml file, or specifically 'files'. What i'm looking to do is basically have a few data tables split into different xml files.

I know i can combine everything into one file, but with the data i have it will be one *big* file, where as not everything will be needed all the time, and more importantly several of the tables will be required in several pages, and i'd like to store a single copy in a single file.

essentially i'm looking at a way of presenting some data via xml & xsl on a small intranet, problem is we don't have a server i can use, its just placing files on a networked drive, thus scripting etc is out hence this problem.

Is there a way to read multiple files into an xsl file?

even if there is a core xml file, that essentially calls other files if required (the 'calls' can be hard coded fine, its justt eh contents that will by dynamic)

mpjbrennan
02-01-2005, 10:46 PM
Claire,

One of the major weaknesses of XSLT is that an xsl file has to be called from an xml file, rather than the other way round. Why this is so I have no idea, it would be so useful if one could write a raw xml file and call it from several different xsl files, but unfortunately this is not the case. If you want to hold your xml data in a central file and present it it more than one format then you must use scripting - either client-side (e.g. javascript) or server-side (e.g. PHP) to achieve your objective.

Patrick

claire rand
02-02-2005, 07:15 PM
pity, still not to worry, tis destined for a local file network so a big file not that much of a problem, but it basically zaps the project me thinks, cept for extracts.

I was looking at XQuery.. till i found out a bit more about it.. server side indeed, if ya gunna do it server side theres not much point to my thinking..

Still thansk for the reply, has clarified a few bits