Re: XSLT processors
To my knowledge, Xerces is an XML parser, and Xalan does the XSLT stuff. Hope you got that right in your book :-). I used Xerces to write a custom tag for a JSP book I co-wrote that's coming out in a month or so. The tag looks like this on a JSP, for example: synd:rdf rdfURL="http://www.slashdot.org/slashdot.rdf" xslURI="xml/rdf092.xsl"/ It's slowed by the initial request for the RDF page, but if you have all your XML and XSL local or in a database, this stuff goes much quicker (but doing syndication will always require someone/something to hit the Web for updates). The code is very simple and just uses the Xerces APIs to do the processing. You could also include the dynamic XML output of one JSP into another JSP or servlet, which could then call XSLT engine APIs and a stylesheet to convert the XML to another type of data. My main beef about Xerces is that it's 1.5 MB. That's way too big if all you want is a fast, light XSLT engine. But its' free and it's got features and it works well and its very easy to use. James Clark has a lightweight XSLT processor:
RE: XSLT processors
Oh, you caught that! I thought it might slip by after I sent it and realized it myself. Yes, I did get it right in the book. More pluses/minuses on Xerces and Xalan: Xalan Java is the XSLT processor, which was 843 KB last time I checked. It depends on Xerces by default, which was/is around 1.5 MB. The plus is that you can use Xalan with other XML parsers that support DOM 2/SAX 1. Scott -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Christian Sell Sent: Thursday, October 12, 2000 3:10 AM To: Orion-Interest Subject: Re: XSLT processors To my knowledge, Xerces is an XML parser, and Xalan does the XSLT stuff. Hope you got that right in your book :-).
RE: XSLT processors
Hello everyone. If anyone has some standard HTML pages set up on Orion, without the corresponding servlets, EJBs, etc., I would love to see the XML configuration files that were set up. I had to append this message, since I am not sure of the group address. -Original Message-From: Duffey, Kevin [mailto:[EMAIL PROTECTED]]Sent: Wednesday, October 11, 2000 2:57 PMTo: Orion-InterestSubject: RE: XSLT processors I would be interested in knowing how to even use an XSLT engine! I know I can get JSP to output XML with a header, but how do I actually pass the XML to the XSLT engine, and how do I specify I want HTML or WML output? Is it a servlet, and you just call upon it somehow from a JSP page or when a request is made, inside you grab the page using a URL connection to get XML output from the JSP page, then pass it on to an XSLT engine somehow? I guess I should buy a book on this topic..but I was hoping it would be easy enough to figure out. Thanks. -Original Message-From: Derek Akers [mailto:[EMAIL PROTECTED]]Sent: Wednesday, October 11, 2000 7:53 AMTo: Orion-InterestSubject: XSLT processors I have been using Xalan and JAXP as XSLT processors for the past little while, and have recently become aware of Saxon as well. I was wondering if there is anyone out there who has used all three (or at least some combination) at various times who would be willing to tell me what differences there are between the three re: processing efficiency, ease of use, documentation, community, etc. Thanks, Derek Akers Internet Application DeveloperEldan Software, Torontowww.eldan.com
RE: XSLT processors
Take a look at the XSLT Programmer's Reference: http://www.bookpool.com/.x/micoqah72r/ss/1?qs=xslt At 12:56 PM 10/11/00 -0700, you wrote: I would be interested in knowing how to even use an XSLT engine! I know I can get JSP to output XML with a header, but how do I actually pass the XML to the XSLT engine, and how do I specify I want HTML or WML output? Is it a servlet, and you just call upon it somehow from a JSP page or when a request is made, inside you grab the page using a URL connection to get XML output from the JSP page, then pass it on to an XSLT engine somehow? I guess I should buy a book on this topic..but I was hoping it would be easy enough to figure out. Thanks. -Original Message- From: Derek Akers [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 11, 2000 7:53 AM To: Orion-Interest Subject: XSLT processors I have been using Xalan and JAXP as XSLT processors for the past little while, and have recently become aware of Saxon as well. I was wondering if there is anyone out there who has used all three (or at least some combination) at various times who would be willing to tell me what differences there are between the three re: processing efficiency, ease of use, documentation, community, etc. Thanks, Derek Akers Internet Application Developer Eldan Software, Toronto http://www.eldan.comwww.eldan.com Kirk Yarina [EMAIL PROTECTED]
RE: XSLT processors
I would be interested in knowing how to even use an XSLT engine! I know I can get JSP to output XML with a header, but how do I actually pass the XML to the XSLT engine, and how do I specify I want HTML or WML output? Is it a servlet, and you just call upon it somehow from a JSP page or when a request is made, inside you grab the page using a URL connection to get XML output from the JSP page, then pass it on to an XSLT engine somehow? I guess I should buy a book on this topic..but I was hoping it would be easy enough to figure out. Thanks. -Original Message-From: Derek Akers [mailto:[EMAIL PROTECTED]]Sent: Wednesday, October 11, 2000 7:53 AMTo: Orion-InterestSubject: XSLT processors I have been using Xalan and JAXP as XSLT processors for the past little while, and have recently become aware of Saxon as well. I was wondering if there is anyone out there who has used all three (or at least some combination) at various times who would be willing to tell me what differences there are between the three re: processing efficiency, ease of use, documentation, community, etc. Thanks, Derek Akers Internet Application DeveloperEldan Software, Torontowww.eldan.com
RE: XSLT processors
Since folks are talking about this at the moment I'd like to chime in. Basically your running the XML through an XSLT processor and you have a stylesheet which translates the incoming XML to whatever based on the rules defined in your stylesheet. I'd like to read more about how folks are using XSLT in conjuction with JSP. I don't mean just to do multi channel delivery but more so how they are able to define layout using XSL instead of using scriptlets to generate HTML. On Wed, 11 Oct 2000, Duffey, Kevin wrote: I would be interested in knowing how to even use an XSLT engine! I know I can get JSP to output XML with a header, but how do I actually pass the XML to the XSLT engine, and how do I specify I want HTML or WML output? Is it a servlet, and you just call upon it somehow from a JSP page or when a request is made, inside you grab the page using a URL connection to get XML output from the JSP page, then pass it on to an XSLT engine somehow? I guess I should buy a book on this topic..but I was hoping it would be easy enough to figure out. Thanks. -Original Message- From: Derek Akers [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 11, 2000 7:53 AM To: Orion-Interest Subject: XSLT processors I have been using Xalan and JAXP as XSLT processors for the past little while, and have recently become aware of Saxon as well. I was wondering if there is anyone out there who has used all three (or at least some combination) at various times who would be willing to tell me what differences there are between the three re: processing efficiency, ease of use, documentation, community, etc. Thanks, Derek Akers Internet Application Developer Eldan Software, Toronto www.eldan.com http://www.eldan.com
RE: XSLT processors
The processing instruction : ?xml-stylesheet href="doc.xsl" type ="text/xsl"? tells the processor to use the style sheet of doc.xsl to transform this xml document(or jsp). To do conditional processing dependent on the client, you need to do some logic in the jsp to figure this out, and display the appropriate processing instruction. I have implemented the appropriate logic in a custom tag that I am attaching to this email. It has been available at orionsupport.com for a little bit, but alas, no longer. (See attached file: xsltags.zip) James Birchfield Ironmax a better way to buy, sell and rent construction equipment 5 Corporate Center 9960 Corporate Campus Drive, Suite 2000 Louisville, KY 40223 |+ || "Duffey, Kevin" | || [EMAIL PROTECTED]| || Sent by: | || owner-orion-interest@orion| || server.com| ||| ||| || 10/11/00 03:56 PM | || Please respond to | || Orion-Interest| ||| |+ -| | | | To: Orion-Interest [EMAIL PROTECTED] | | cc: | | Subject: RE: XSLT processors | -| I would be interested in knowing how to even use an XSLT engine! I know I can get JSP to output XML with a header, but how do I actually pass the XML to the XSLT engine, and how do I specify I want HTML or WML output? Is it a servlet, and you just call upon it somehow from a JSP page or when a request is made, inside you grab the page using a URL connection to get XML output from the JSP page, then pass it on to an XSLT engine somehow? I guess I should buy a book on this topic..but I was hoping it would be easy enough to figure out. Thanks. -Original Message- From: Derek Akers [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 11, 2000 7:53 AM To: Orion-Interest Subject: XSLT processors I have been using Xalan and JAXP as XSLT processors for the past little while, and have recently become aware of Saxon as well. I was wondering if there is anyone out there who has used all three (or at least some combination) at various times who would be willing to tell me what differences there are between the three re: processing efficiency, ease of use, documentation, community, etc. Thanks, Derek Akers Internet Application Developer Eldan Software, Toronto www.eldan.com .ZIP File
RE: XSLT processors
You'll probably get lots of replies on this, and I'm no XSLT guru by any means, but I have some words. 1. When you write your XSLT sheets, you can specify a few output helper methods: xsl:output method="html" indent="yes" omit-xml-declaration="yes"/ 2. You determine in your XSLT what rules and replacements happen to the input data. If you input XML and you want to output HTML or WML or Java (BTW, this is how JRun creates servlets from JSPs: JSP parsed to--XML--apply XSLT-- get Java) or whatever, you match up expected input XML elements in your XSLT, and specify template data that you want to replace the XML element (at least this is the easy way to do it): Here's a section of XSLT where I am matching against incoming RSS XML elements (channel, title, and item) and outputting an HTML table of that data: xsl:template match="channel" table border="1" cellpadding="2" cellspacing="0" tr bgcolor="#aa" td b font size="+1" color="#ff" xsl:value-of select="title"/ /font /b /td /tr tr td xsl:apply-templates select="item"/ /td /tr /table /xsl:template Usually you use these XSLT engines by instantiating an instance of the engine or an interface to it, and passing XML, XSL, and an instance of an OutputStream to one or many constructors/methods. The engine takes the two input sources, does its magic, and spits out the output to the out stream of your choice. I used Xerces to write a custom tag for a JSP book I co-wrote that's coming out in a month or so. The tag looks like this on a JSP, for example: synd:rdf rdfURL="http://www.slashdot.org/slashdot.rdf" xslURI="xml/rdf092.xsl"/ It's slowed by the initial request for the RDF page, but if you have all your XML and XSL local or in a database, this stuff goes much quicker (but doing syndication will always require someone/something to hit the Web for updates). The code is very simple and just uses the Xerces APIs to do the processing. You could also include the dynamic XML output of one JSP into another JSP or servlet, which could then call XSLT engine APIs and a stylesheet to convert the XML to another type of data. My main beef about Xerces is that it's 1.5 MB. That's way too big if all you want is a fast, light XSLT engine. But its' free and it's got features and it works well and its very easy to use. James Clark has a lightweight XSLT processor: http://jclark.com/xml/xt.html Here are some other pointers: Producing HTML tables with XSLT http://www.cogsci.ed.ac.uk/~dmck/xslt-tutorial.html List of Books, articles and papers: http://www.oasis-open.org/cover/xsl.html#articles See in particular the free online stuff from the "XSLT Programmer's Reference," By Michael Kay. Lots of free code and examples you can download. I've also found the Cocoon XSL examples from xml.apache.org to be helpful. Scott Stirling West Newton, MA -Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Duffey, Kevin Sent: Wednesday, October 11, 2000 3:57 PM To: Orion-Interest Subject: RE: XSLT processors I would be interested in knowing how to even use an XSLT engine! I know I can get JSP to output XML with a header, but how do I actually pass the XML to the XSLT engine, and how do I specify I want HTML or WML output? Is it a servlet, and you just call upon it somehow from a JSP page or when a request is made, inside you grab the page using a URL connection to get XML output from the JSP page, then pass it on to an XSLT engine somehow? I guess I should buy a book on this topic..but I was hoping it would be easy enough to figure out. Thanks.
RE: XSLT processors
well i was waiting for data-binding from Sun for this( which has been in JSR for a long... time now). With that servlets will create Java objects which in post filter( servlet 2.3) get converted to XML tree using data binding. Then pass the XML thru XSLT and get the HTML out. - Krishnan -Original Message- From: Duffey, Kevin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 11, 2000 4:30 PM To: Orion-Interest Subject: RE: XSLT processors You said it best..that is exactly what I am wondering. Right now I use JSP to do the "VIEW", thus I put scriplets for conditional rendering, as well as using JavaBeans populated by the logic code that is then rendered. I am wondering..since I don't want to put XML output in my code directly (as we used to do with Servlets and HTML using the response buffer), how exactly can we utilize the awesome conditional scriplet stuff of JSP to render good XML that can then be translated to HTML, PDF, RTF or WML in real-time, all the while not killing performance. Obviously the extra step to use an XSL and XML to produce the final output will take (I would think at least 2x or more) longer, but we also want to still be able to give reasonable performance for several 1000 users using our site throughout a 24-hour day. On that note..how would high-volume sites deal with this? Would they just have 100's of web-servers in multiple farms to handle the load, just add more to handle more? Orion has a kewl way of doing this with its island setup, but I am not sure if any load-balancer can properly handle say 30 islands, each with 3 servers running Orion, or not. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 11, 2000 2:40 PM To: Orion-Interest Subject: RE: XSLT processors Since folks are talking about this at the moment I'd like to chime in. Basically your running the XML through an XSLT processor and you have a stylesheet which translates the incoming XML to whatever based on the rules defined in your stylesheet. I'd like to read more about how folks are using XSLT in conjuction with JSP. I don't mean just to do multi channel delivery but more so how they are able to define layout using XSL instead of using scriptlets to generate HTML. On Wed, 11 Oct 2000, Duffey, Kevin wrote: I would be interested in knowing how to even use an XSLT engine! I know I can get JSP to output XML with a header, but how do I actually pass the XML to the XSLT engine, and how do I specify I want HTML or WML output? Is it a servlet, and you just call upon it somehow from a JSP page or when a request is made, inside you grab the page using a URL connection to get XML output from the JSP page, then pass it on to an XSLT engine somehow? I guess I should buy a book on this topic..but I was hoping it would be easy enough to figure out. Thanks. -Original Message- From: Derek Akers [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 11, 2000 7:53 AM To: Orion-Interest Subject: XSLT processors I have been using Xalan and JAXP as XSLT processors for the past little while, and have recently become aware of Saxon as well. I was wondering if there is anyone out there who has used all three (or at least some combination) at various times who would be willing to tell me what differences there are between the three re: processing efficiency, ease of use, documentation, community, etc. Thanks, Derek Akers Internet Application Developer Eldan Software, Toronto www.eldan.com http://www.eldan.com