• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is The XSLT Transformation Platform Independent?

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can we use XSLT to transform XML into HTML on any platform? I mean if it works if we have MS/Solaris or Linux equipment?
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
XSLT is a standard language whose specification has been standardised by the W3C. You can find the specification at the following URL:
http://www.w3.org/TR/xslt
This specification has been implemented by different vendors and you can also find open-source implementations. Implementations of XSLT processors exists for all major languages (C++, Java, Perl, etc) and for all platforms.
As soon as you stylesheet is written according to the specification, it can be run with any XSLT processor on any OS.
One of the feature of XSLT is to allow output in many different formats. The 3 output formats that are part of the spec are xml, html and text, but you may also use XSL Formating Objects along with a Formatting Objects Processor. For instance Apache FOP is an open-source implementation of XSL-FO). Formatting objects allow you to prepare a document including graphics. You can then output this document in various document formats(PDF, PS, SVG).
XSLT processors written in Java will run (and behave) exactly the same on all OSes, assuming you are using the same version of the JDK.
If you want to use a Java based XLST processor, I would recommend Xalan as it's one of the most widely used. Additionaly, a version of this processor has been included in the lastest JDK 1.4 which runs on all plaforms.
Best luck
[ December 16, 2002: Message edited by: Beno�t d'Oncieu ]
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written XSLT which has worked in both VB and Java. I didn't use advanced features but it worked just fine.
It's rare that you can write something that works in both those worlds so I was quite pleased.
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your detailed reply. Therefore, XSLT runs on MS/Solaris as well as on Linux. Is it true?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
TRUE !
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot, Beno�t.
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to XML and its related technologies. I am simply following what I have read on the subject and online instructions to transform XML to HTML using XSLT. And I try to make the transformation work on both the client side and server side.
Someone told me to write a Java program that takes XML as input and produce HTML as output.
I personally would not do it this way unless there are Java packages/classes available to do the transformation (Are there?). According to my limited knowledge in the field, it takes worthless effort to write a Java program to do it.
I post this message to welcome feedbacks to my personal opinion.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are Java APIs to do this transform.
Which version of the JDK are you using?
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using JDK1.4.0_01 and how this kind of transformation is done?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JDK 1.4 includes APIs for parsing XML and transforming XML (via XSL stylesheets), so you shoudn't need anything else, unless performance is important.
Here is a simple utility class to do your XSL transformations from your code.

You would use it like that:

Hope this helps
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much, Beno�t. I used your code and got the expected output. Now, I have learned to transform XML to HTML on the client side, on the server using a servlet, and using a Java program.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic