You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Albert Tsun <al...@excel.com.hk> on 2001/02/21 10:28:24 UTC
XSL parsing error on Xalan-Java2
Hi Gary,
I have downloaded the new Xalan-Java2, there is some difference from the
one I used xalan-j_1_2_D02.
(1) In my previously worked XSL, I usually put below section at the
begining of each file
<!DOCTYPE xsl:stylesheet [
<!ENTITY nl "<xsl:text>
</xsl:text>">
<!ENTITY nbsp "<xsl:text> </xsl:text>">
]>
and I use
&nl;
somewhere inside the XSL.
However, when I use transform
transformer = tFactory.newTransformer(new StreamSource(xslfile));
The parser seems to treat it as invalid syntax and shows error. However, it
was OK when I use xalan-j_1_2_D02..
(See attached file: ClientPortfolioRpt.text.xsl)(See attached file:
R101_SETADM_20010221165653.xml)
(2) Besides, I want to check that if the follow call is THREAD-SAFE in
multi-thread env.
transformer.transform(new StreamSource(xmlfile), new StreamResult(new
FileOutputStream(datafile)));
Because I find previous version call seems to have multi-thread
problems.
i.e. XSLTProcessor.process(new XSLTInputSource(xmlfile),
new XSLTInputSource(xslfile),
new XSLTResultTarget(new FormatterToText(fw)));
Is there any ways I can solve it if I want to use the new Xalan-Java2 API ?
Thanks in advance.
Re: XSL parsing error on Xalan-Java2
Posted by Gary L Peskin <ga...@firstech.com>.
Albert Tsun wrote:
>
> Hi Gary,
>
> I have downloaded the new Xalan-Java2, there is some difference from the
> one I used xalan-j_1_2_D02.
>
> (1) In my previously worked XSL, I usually put below section at the
> begining of each file
>
> <!DOCTYPE xsl:stylesheet [
> <!ENTITY nl "<xsl:text>
</xsl:text>">
> <!ENTITY nbsp "<xsl:text> </xsl:text>">
> ]>
>
> and I use
> &nl;
>
> somewhere inside the XSL.
>
>...
Albert --
Thanks for the sample files. I ran this in the debugger and the problem
seems to lie with Xerces. It is passing an invalid localName into our
ContentHandler, org.apache.xalan.processor.StylesheetHandler. The local
name should be "text" but it is "text>\u000a</xsl:text>" which is
obviously not correct.
Later today, I'll head over to the Xerces CVS and see if this is a
problem that has been corrected or at least identified. You might want
to do that yourself and let us know if you get there before I do.
Gary