[
http://issues.apache.org/jira/browse/XALANJ-2111?page=comments#action_64448 ]
Antonio Gallardo commented on XALANJ-2111:
------------------------------------------
Sorry for the lot loud before this comment. I'm not a Jira expert. ;-)
For all of this I used the xalan as is in CVS now.
I added 2 attachments:
1- dump.txt - created using eclipse and setting a breakpoint on first NPE.
This is why the first line said the Thread was suspended.
2- output.txt - the exception message in the console. Here shows the exception
is throw in other place but the cause is the same NPE as in dump.txt
Please note the Cocoon TraxTransformer and other related classes works good and
is used in production in a lot of sites. I tried to create a show case of this
bug using:
java -Djava.endorsed.dirs=. -cp xalan.jar:xml-apis.jar:xercesImpl-2.6.2.jar
org.apache.xalan.xslt.Process -IN hello.xml -XSL page2html.xsl -HTML
But is was imposible to me to reproduce it.
- 0 -
A- Here is the input XML file that works:
http://svn.apache.org/viewcvs.cgi/cocoon/branches/BRANCH_2_1_X/src/webapp/samples/hello-world/content/hello.xml?view=markup
B- Here is the XSLT file:
http://svn.apache.org/viewcvs.cgi/cocoon/branches/BRANCH_2_1_X/src/webapp/samples/hello-world/style/xsl/page2html.xsl?view=markup
If (A) is used "AS IS", then everything works good. But is we replace in (A)
the line:
<para>This is my first Cocoon page!</para>
with:
<para>This is my <b>first</b> Cocoon page!</para>
(Note the added <b> elements). Then throws the exception.
Since we have a default namespace, that means every element including the <b>
element should the considered as an XML element. My question is, why is the
code going to line 852 if this will go throught line 840?
Here is a snipet of ToHTMLStream.java:
line 839: // if the element has a namespace, treat it like XML, not HTML
line 840: if (null != namespaceURI && namespaceURI.length() > 0)
line 841: {
line 842: super.endElement(namespaceURI, localName, name);
line 843:
line 844: return;
line 845: }
line 846:
line 847: try
line 848: {
line 849:
line 850: ElemContext elemContext = m_elemContext;
line 851: final ElemDesc elemDesc = elemContext.m_elementDesc;
line 852: final int elemFlags = elemDesc.getFlags();
line 853: final boolean elemEmpty = (elemFlags & ElemDesc.EMPTY) != 0;
> NPE in o.a.xml.serializer.ToHTMLStream.endElement()
> ---------------------------------------------------
>
> Key: XALANJ-2111
> URL: http://issues.apache.org/jira/browse/XALANJ-2111
> Project: XalanJ2
> Type: Bug
> Components: Serialization
> Versions: 2.6
> Environment: Cocoon 2.1.7
> Reporter: Antonio Gallardo
> Attachments: dump.txt, dump.txt, output.txt
>
> See: http://issues.apache.org/bugzilla/show_bug.cgi?id=34386
> The solution is to comment lines blocks from 726 to 731 and 840 to 845 in
> org.apache.xml.serializer.ToHTMLStream.java (current CVS).
> This makes the serializer to service the SAX events as XML and this seems to
> be
> the cause of the trouble.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]