Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 26th, 2012, 01:26 PM
Authorized User
 
Join Date: Nov 2012
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default Parsing XML with XSLT or SAX/STAX

Hi!

I have to parse a lot of xmls to convert them from xml to text, and I´m looking for the fastest way to do it.

I´m not sure whether to build a xslt and run it with Saxon, or parsing xmls with a Java implementation of Sax or Stax APIs and produce text output.

Please, I´d need your experience. Thanks!
 
Old November 26th, 2012, 02:03 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Writing it in Java rather than XSLT is unlikely to give you more than a 10% improvement, and to achieve that you will have to write a lot more code and probably do some performance tuning.

There's no intrinsic difference between the performance of SAX and StAX parsers. Woodstox is probably the fastest conformant parser around, but it's probably only 5% to 10% faster than Apache Xerces on most workloads.

My recommendation would be to use Saxon with the default parser; if that's not fast enough for you, the cheapest way to improve the performance is to buy faster hardware.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old November 27th, 2012, 04:26 AM
Authorized User
 
Join Date: Nov 2012
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thank you very much for the response accuracy, Michael.

Best regards!





Similar Threads
Thread Thread Starter Forum Replies Last Post
XML parsing in XSLT bsudhindra XSLT 5 October 8th, 2012 07:31 AM
org.xml.sax.SAXParseException: Premature end ksskumar XSLT 1 March 19th, 2008 04:01 AM
How to parse xml using SAX Parser?? priyatowin XSLT 2 September 8th, 2006 02:56 AM
Urgent help regarding XSLT parsing.... to xml.. netbramha XSLT 1 September 19th, 2005 09:03 AM
import org.xml.sax is deprecated sax XML 1 November 17th, 2003 08:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.