Meaningless Drivel is fun!*
The moose likes XML and Related Technologies and the fly likes XSL or Java?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSL or Java??" Watch "XSL or Java??" New topic
Author

XSL or Java??

Kamakshi Mahadevan
Greenhorn

Joined: Nov 08, 2000
Posts: 18
I have an XML document which has to be converted to not one but a set of interrelated HTML files(one HTML referring to another etc) .. is it possible to use XSL to dynamically generate more than one HTML file from an XML doc?? or do i have to use a parser and code it in Java??

XSL users, pls help..
Kamakshi
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Kamakshi, what do you mean by "dynamically generate more than one HTML file"? You will not save them as a file? As far as I can imagine one XSL stylesheet can transform XML document into one HTML document, but you can assign XSLTs dynamically and get different HTML representation. Here is one such example: http://www.xmlpitstop.com/Examples/WebWorkShop/Multiple_views/multiple.htm
Is it what you wanted?

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
FredLoney
Greenhorn

Joined: Mar 27, 2001
Posts: 6
File redirection is an xslt extension. For the xalan processor the relevant url is:
http://xml.apache.org/xalan/extensions.html#ex-redirect
Other processors have similar extensions.
Originally posted by Kamakshi Mahadevan:
I have an XML document which has to be converted to not one but a set of interrelated HTML files(one HTML referring to another etc) .. is it possible to use XSL to dynamically generate more than one HTML file from an XML doc?? or do i have to use a parser and code it in Java??

XSL users, pls help..
Kamakshi


Fred Loney<br />Spirited Software, Inc.<br />loney@spiritedsw.com
Kamakshi Mahadevan
Greenhorn

Joined: Nov 08, 2000
Posts: 18
Mapraputa & Fred,
Thanks for your response. i looked at the examples in the links you had mentioned.
Mapraputa, you are right.. i actually want to save these html files. i used the wrong term 'dynamically generated'.
the example in your link gives different html representations of the same XML doc, right?? i want to direct different parts of the XML document to different HTML files and these HTML files should have links between them .
looking into Fred's link, i am convinced that XSLT extensions can be used to achieve this..
could you guys suggest some good links to learn XSL/XSLT??
thanks
Kamakshi

Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi Kamakshi,
The SAXON parser allows you to output multiple HTML files. I think the function is specific to Saxon. You can d/l it from http://users.iclway.co.uk/mhkay/saxon/ .
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
GOOD LINKS
To start:
W3school tutorial gives a good overview.
To really understand how XSLT works, there is a free chapter from Professional Visual Basic 6 XML:
Doing XPath and XSLT with Style!
Inspite of �VB� in its title this chapter is very good, probably the best of what you can find about XSLT for free
To see examples of various XSLT elements and functions:
XPath tutorial by examples
XSLT reference with examples
And finally you are ready to read this FAQs with a lot of advanced questions:
Jeni's XSLT Pages
XSL Frequently Asked Questions
XSLT Questions and Answers

[This message has been edited by Mapraputa Is (edited March 31, 2001).]
Kamakshi Mahadevan
Greenhorn

Joined: Nov 08, 2000
Posts: 18
Thanks for the links Mapraputa.
just what I wanted..
Kamakshi
 
GeeCON Prague 2014
 
subject: XSL or Java??