|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Can input xml and stylesheet be passed as strings to
Sorry, I haven't been keeping up with this thread. It really belongs on
the xalan-dev list.
Dimitre Novatchev <dnovatchev@xxxxxxxxx> wrote:
> char[] xslbuf = styleSheet.toCharArray();
> CharArrayReader carStyle = new CharArrayReader(xslbuf);
>
> char[] xmlbuf = inputXML.toCharArray();
> CharArrayReader carInput = new CharArrayReader(xslbuf);
>
> {
> XSLTInputSource xmlSource = new XSLTInputSource(carInput);
> Node xmlNode = m_processor.getSourceTreeFromInput(xmlSource);
>
> XSLTInputSource xslSource = new XSLTInputSource(carStyle);
> Node xslNode = m_processor.getSourceTreeFromInput(xslSource);
This all seems very strange. For one thing, are you sure you want to hand
in the xslbuf for both readers? And why do you want to create DOMs?? I
would think you would want to do:
java.io.StringReader carInput = new java.io.StringReader(inputXML);
java.io.StringReader carStyle = new java.io.StringReader(styleSheet);
org.apache.xalan.xslt.StylesheetRoot stylesheet
= m_processor.processStylesheet(new XSLTInputSource(carStyle));
stylesheet.process(m_processor, new XSLTInputSource(carStyle), new
XSLTResultTarget(pw));
pw.flush();
return osw.toString();
(I assume you know that the Processor object is not meant to be used
concurrently over multiple threads).
> Input XSL; Line 1; Column 1
> org.apache.xalan.xslt.XSLProcessorException: The root element is
> required in a well-formed document.
The DOM that was handed in didn't have a root element. I don't think the
parse (getSourceTreeFromInput) succeded. Not sure why without being in a
debugger.
It looks like you were copying code out of the client applet?
-scott
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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








