Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / November 2005

Tip: Looking for answers? Try searching our database.

XSLT newbie - Xalan questions?

Thread view: 
Piper707@hotmail.com - 11 Nov 2005 06:09 GMT
Hi,

I am trying to understand how XSLT works and Xalan (or Saxon) fits in.

I understand we need 4 things to get a transformation:  source, result,
xsl file and a transformer.

It seems, using only Java APIs, it is possible to do a transformation.
as shown in this example:
http://groups.google.com/group/comp.lang.java.help/browse_thread/thread/687a461b
29afc57e/d2152cb764884f59?q=xslt&rnum=10#d2152cb764884f59


1) I'm not sure what purpose Xalan serves? Is it an alternate more
efficient Transformer that can be used ?

2) This O'Reilly example (Ex 5-3)
http://www.onjava.com/pub/a/onjava/excerpt/java_xslt_ch5/index.html?page=3

says "was developed and tested using Apache's Xalan 2 processor". But I
dont see any non Java packages/objects used to do the transformation.
What role is Xalan playing here?

3) Some confusion with regards to transformer and processor. Some
examples have processors used, some don't. When do we need one? Do the
processors only serve to read input/output sources?

4) And engines. Can Xalan, Saxon  be called XSLT engines?

Thank you,
Rohit.
pit.grinja@gmx.de - 12 Nov 2005 09:17 GMT
Hi Rohit,
>I understand we need 4 things to get a transformation:  source, result,
>xsl file and a transformer.
In principal, yes. You pass the xsl file (the stylesheet) to the
factory function that returns a new transformer, and then you pass your
desired source and result as arguments to the transform method of your
transformer.
>1) I'm not sure what purpose Xalan serves? Is it an alternate more
>efficient Transformer that can be used ?
It is an xslt engine, yes. It can be used by a java program to perform
an xsl transformation. It might even be the one that your java
installation already uses (that will depend on your jre version). I use
java 1.4.2_08. In my rt.jar, i have a package org.apache.xalan. I am
not sure about the version.
>2) This O'Reilly example (Ex 5-3)
>...
>says "was developed and tested using Apache's Xalan 2 processor". But I
>dont see any non Java packages/objects used to do the transformation.
>What role is Xalan playing here?
The O'Reilly text should have answered your question. When you want to
perform an xsl transformation with java, you should NOT write "give me
an object of the xsl transformer xyz", because that might not work on
other machines where "xyz" is not installed. Instead you say "give me
an object of the default transformer that is installed on this system".
That will work independently of the current installation, provided that
it conforms to the TrAX specification.
>3) Some confusion with regards to transformer and processor. Some
>examples have processors used, some don't. When do we need one? Do the
>processors only serve to read input/output sources?
In general, I´d say that these two termini can be used similarly. One
COULD say "processing" includes all steps starting from reading the
inout and ending with writing the output and that "transforming" only
includes the transformation of one DOM tree to another, but that´s
close to splitting hairs imho.
>4) And engines. Can Xalan, Saxon  be called XSLT engines?
IMHO, yes. Don´t call them XSLT transformation engines ("eXtensible
Stylesheet Language for  Transformation transformation engines" ;-) ).
Also avoid to talk about "LCD displays" ;-).
HTH
Piet


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.