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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML+XSL+JSP

Status
Not open for further replies.

cvf

Programmer
Oct 14, 2001
5
MY
Is there any code sample where I can apply XSL stylesheets to a XML document and display the transformed document using pure JSP not servlets? It seems there are numerous servlet examples but very little on JSP+XML+XSL...

Thanks
 
Dear cvf,

Well first before you can process XML with XSL you need an XML/XSL processor.

Do you have one?
Do you know how to use it from a Java application or even a Java Servlet?

If you can not answer 'Yes' to both of those questions then you are not ready to do any of the above from JSP. If you can do both the above then it's just a matter of understanding JSP better, take a look at the samples that come with the Java Web Server installation (JWSK). To find it go to
"But, that's just my opinion... I could be wrong".
-pete
 
Thanks pete...

I do know how to parse an XML file using the Xerces DOM parser using plain JSP (not servlet or a Java application) but I still do not know how to parse using JAXP or JDOM or Sax parser from within JSP scripts. Also I need to know how to transform a XML file using XSL on the fly from within JSP code not using beans, just plain JSP code.

Thanks
 
Let's recap,

< cvf >
> Also I need to know how to transform a XML file using XSL on the fly from
> within JSP code not using beans, just plain JSP code.

< pete >
> Well first before you can process XML with XSL you need an XML/XSL processor.

So to do that in 'plain JSP code' you would have to write an entire XML/XSL processor in JSP! Yikes!! Double Yikes!!!! If that's what you want to spend your time doing, more power to you.

&quot;But, that's just my opinion... I could be wrong&quot;.
-pete

 
I am already using a XML/XSL processor, I import the processors in my JSP but don't know how to parse/ytransform using the particular processor's syntax....

 
> I am already using a XML/XSL processor, I import the processors in my JSP
>but don't know how to parse/ytransform using the particular processor's syntax

Use the 'XML/XSL processor' inside a Java application development environment and get the syntax correct there. Your IDE should help you resolve syntax errors. Then the same syntax will work in JSP.

Beyond that advice, you would need someone to help you that has experience with the 'exact' API you are working with that could resolve your problems. They would likely need to see your code that causes the syntax errors and the error messages.

-pete
 
i am new to xml/xsl. I've tried some basic examples in xml and xsl (creating microsoft parser object in javascript and then transforming it using the transformNode function). I want to do a similar thing but instead of using javascript i wish to use jsp to create the object. How can i do so?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top