Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000451 [Resin] minor always 11-09-05 00:00 01-10-06 15:48
Reporter mate View Status public  
Assigned To
Priority urgent Resolution no change required  
Status closed   Product Version 3.0.14
Summary 0000451: Resin XSL: Attributes local name is blank
Description RSN-500
Not entirely sure whether the problem lies with Resin or with JDOM, but it works fine with Resin 2.x so my guess is Resin.

When the stylesheet contains attributes without namespace (on elements with namespace) the local name of the attribute will be blank, while the qName will be set. JDOM assumes the local name to be the same as the qName if no prefix/namespace is used.

org.jdom.SAXHandler
536: if (!attQName.equals(attLocalName)) {
537: String attPrefix = attQName.substring(0, attQName.indexOf(":"));

Attached is a serlvet with an example (requiring JDOM).

This bug hinders us from migrating to Resin 3.
Additional Information Resin 3.0.14, JDOM 1.0, JDK 1.5
Attached Files

- Relationships

- Notes
(0000477)
mate
11-09-05 00:00

Here is the top of the stack trace:



java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1768)
    at org.jdom.input.SAXHandler.startElement(SAXHandler.java:537)
    at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
    at org.jdom.transform.JDOMResult$DocumentBuilder.startElement(JDOMResult.java:519)
    at com.caucho.xml.SAXBuilder.popElement(SAXBuilder.java:314)
    at com.caucho.xml.SAXBuilder.pop(SAXBuilder.java:294)
    at com.caucho.xml.SAXBuilder.endDocument(SAXBuilder.java:121)
    at com.caucho.xsl.XslWriter.close(XslWriter.java:383)
    at com.caucho.xsl.StylesheetImpl.transform(StylesheetImpl.java:210)
    at com.caucho.xsl.TransformerImpl.transform(TransformerImpl.java:476)
    at com.caucho.xsl.TransformerImpl.transform(TransformerImpl.java:312)
    at resin3Test.XslProblemServlet.service(XslProblemServlet.java:32)
 
(0000478)
mate
11-09-05 00:00

Looking at the API documentation, http://java.sun.com/j2se/1.5.0/docs/api/org/xml/sax/Attributes.html#getLocalName(int), [^] I'm leaning towards JDOM being the problem. Although Xalan works as Resin 2 did.

I have posted a bug report and patch to JDOM's mailing list. I'll post here when answered.
 
(0000479)
mate
11-09-05 00:00

There will be a fix for this in JDOM 1.0.1, so this issue can be closed.
 

- Issue History
Date Modified Username Field Change
11-09-05 00:00 mate New Issue
01-10-06 15:48 ferg Status acknowledged => closed
01-10-06 15:48 ferg Resolution open => no change required


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
28 unique queries executed.
Powered by Mantis Bugtracker