[ 
http://issues.apache.org/jira/browse/XALANJ-2111?page=comments#action_65855 ]
     
Antonio Gallardo commented on XALANJ-2111:
------------------------------------------

I am using java 1.4.2_08, using an endorsed dir where there are the xalan.jars 
from the CVS. I also copied the xalan jars to cocon libs. Doing this, I think 
is imposible I am running a diferent xalan version. But let me know if this is 
posible after all. I truly want to learn how to debug xalan. ;-)

Here is more info of the problem:

1- Given the XML input:

<page>
 <title>Hello</title>
 <content>
  <para>This is my <b>first</b> Cocoon page!</para>
 </content>
</page>

2- Knowing we are using in the XSLT:

xmlns="http://www.w3.org/1999/xhtml";

3- Debugging the code, in org.apache.templates.ElemCopy, lines 160-164:

160: super.execute(transformer);
161: rthandler.processNSDecls(sourceNode, nodeType, dtm);
162: transformer.executeChildTemplates(this, true);
163:
164: String ns = dtm.getNamespaceURI(sourceNode);

The namespace becomes null only for <b> in line 164! I wonder why this happen 
inside the transformation inside cocoon and not using the command line. The 
namespace should be the default namespace or not? (See point 2, above).

Since the namespace there becomes null for <b> (a nested tag), the NPE raises 
later inside org.apache.xml.serializer.ToHTMLStream in line 852. In 851 
elemDesc is initialized with a null value and in 852 we cannot call the method 
getFlags():

851: final ElemDesc elemDesc = elemContext.m_elementDesc;
852: final int elemFlags = elemDesc.getFlags();


4-If I remove from the input XML file the tags "<b>" and "</b>", then the 
transformation success. Why it does not works with the <b> (or whatever tags?). 
As I pointed before, I was unable to reproduce this using the command line.

***************************************************************

If you wish, I can write down exactly what you need to do (using cocoon) to see 
the error. It is part of the cocoon samples, where we need to add the <b> tags.


> 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]

Reply via email to