|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: fault tolerant saxon:parse()
>> Not too sure at the moment how to incorporate tagsoup as it expects >> the concrete DefaultHandler as opposed to the interface > >> as it expects the concrete DefaultHandler as opposed to the interface >> ContentHandler... > > bah humbug java witterings, :) I've got that bit sorted now... TransformerFactory tFactory = new net.sf.saxon.TransformerFactoryImpl(); Transformer transformer = tFactory.newTransformer(new StreamSource(new File(xslPath))); Map tagSoupMap = new HashMap(); SAXParserImpl saxParser = org.ccil.cowan.tagsoup.jaxp.SAXParserImpl.newInstance(tagSoupMap); SAXSource ss = new SAXSource(saxParser.getXMLReader(), new InputSource(new File(xmlPath).toURI().toString())); StringWriter sw = new StringWriter(); Result result = new StreamResult(sw); transformer.transform(ss, result); Still not quite right though - the post-tagsoup markup is quite a bit different from the input... I probably just need to tweak some settings -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








