[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

Subject: Re: Can input xml and stylesheet be passed as strings to
From: "Scott Boag/CAM/Lotus" <Scott_Boag@xxxxxxxxx>
Date: Mon, 31 Jul 2000 20:23:08 -0400
passed cam
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.