Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSL or Java??

 
Kamakshi Mahadevan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
FredLoney
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Kamakshi Mahadevan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the links Mapraputa.
just what I wanted..
Kamakshi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic