Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSL Transformation through a servlet

Status
Not open for further replies.

LuckyKoen

Programmer
Feb 14, 2005
57
0
0
BE
I have a servlet that uses the TransformerFactory to produce html from an XML and XSL document. I only want to show a specific part of the XML document however, and which part depends on another function in the servlet.

I'm not sure how to approach this problem. Should I first edit the xsl file and then do the transformation ? Should I first select the xml data I need before doing the transformation ? Or are there better alternatives ?

 
answer:

you can do either.

if its a particularly large set of data, use xpath and Dom Document methods to select the correct XML snippet and then transform it using xslt (i am guessing its marginally faster this way).

or

if its a small xml file, just use xslt to transform the bit of the file you need.

either way, both will work nicely.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top