I am converting a XML to HTML using XSLT.
The output of should have 2 HTML files linked with each other.
In the first html there will be a list of data and once I click on a particular data I should get the details of that particular data in other html file. I need to use xslt for this.
I have used Saxon to generate multiple htmls but I am able to perform the linking functionality. Any ideas on how to do this?
My input look like this
<a:file>
<a:id>33</a:id>
<a:name>hello</a:name>
<a:school>mumbai public</a:school>
<a:marks>80</a:marks>
</a:file>
Well Saxon 9 or any XSLT 2.0 processor can generate multiple result documents with one stylesheet, as for linking two documents there is nothing difficult about this, you would simply use an HTML
aelement with ahrefattribute linking to the other document.If you need help on this for a particular data then please post a small but representative XML input sample and also the HTML you want to create.
[edit]
Assuming you have an input document with a couple of those
a:fileelements and you want to create one main HTML document listing alla:nameslinking to separate files listing the details you can solve that as follows:Untested but should give you an idea. If you need more help then please show more details of your input and wanted output, I had to make up the format of both the main HTML result (used a list there) and the details files (used a table there).
[edit 2]
Assuming the complete input sample is
and the complete stylesheet sample is
then when I use Saxon 9.4 HE from the command line doing e.g.
java -jar saxon9he.jar input.xml sheet.xsl -o:result.htmlI get two result files, the main of course beingresult.html, the other being33.htmlwhich look as follows:So that works fine for me, both as far as the number of files is concerned as well as for the linking working inside the browser.