aspose file tools*
The moose likes XML and Related Technologies and the fly likes xsl or not xsl? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xsl or not xsl?" Watch "xsl or not xsl?" New topic
Author

xsl or not xsl?

aude tantot
Ranch Hand

Joined: May 21, 2001
Posts: 39
i've heard that through java, i can display an xml doc in my browser without using xsl, is that true?
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
The browser will display the XML document as is. If you need to extract parts of the document and format them in a different order you will need to use XSL. Infact the browser uses a dummy XSL that simply traverses all the nodes and prints the contents.
The capability of a browser to display an XML document should not be considered as an alternative to using XSLs. For example, a browser is of no use if you have to generate the formatted XML, say in the pdf format or MSWord format on the server!
HTH
------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Gemini Moses
Ranch Hand

Joined: Jan 04, 2001
Posts: 245
Hi Audi,
Do you mean to parse the xml document with parser? and using DOM/SAX to traverse through them?
I am not sure if I am right in saying this..
aude tantot
Ranch Hand

Joined: May 21, 2001
Posts: 39
in fact, i generate, xml thru java and i would like to display it in a pretty look in my browser, i know i can do that with xsl, but i've heard i can do so without it directly thru java (what i feel incredible, that's why i ask if that's true)
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Yes, you can use "on-the-fly" transformation using any standard XSLT engine. For example, checkout the XALAN API form Apache. Using the Transformer class and a stylesheet, you can easily generate the output (HTML/TXT/any other format) file.
HTH
------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: xsl or not xsl?