You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Ma...@nokia.com on 2001/05/25 12:37:33 UTC

XSL together with XML2Java mapping

hi all,
	i need a consultancy from you gurus..

what i want to do is this: having an incoming XML, use XSL for
'transforming' it and have as output
a Java object (can be an hashtable for example)

as far as i know, easiest way to do that is to give the XML to an XSL
processor, have as output an
XML string and give this XML sting to a SAX Parser.

is it possible to have an hashtable as output of an XSL processor (and so
avoid to give the XML string
to a SAX parser) ???

thanx in advance and regards
	marco

Re: XSL together with XML2Java mapping

Posted by Morten Jorgensen <mo...@ireland.sun.com>.
Hi Marco,

I suggest you create a class that implements the
org.xml.sax.ContentHandler
interface and plug that into your XSL processor. Your class can then
populate a Hashtable as it receives the SAX events from the XSL
processor.
In this way there is no need to parse the XSL processor's output.

Morten Jorgensen


Marco.Mistroni@nokia.com wrote:
> 
> hi all,
>         i need a consultancy from you gurus..
> 
> what i want to do is this: having an incoming XML, use XSL for
> 'transforming' it and have as output
> a Java object (can be an hashtable for example)
> 
> as far as i know, easiest way to do that is to give the XML to an XSL
> processor, have as output an
> XML string and give this XML sting to a SAX Parser.
> 
> is it possible to have an hashtable as output of an XSL processor (and so
> avoid to give the XML string
> to a SAX parser) ???
> 
> thanx in advance and regards
>         marco