  | |  | Commented: (XERCESJ-1178) Error getting prefix for an attribute with no n | Commented: (XERCESJ-1178) Error getting prefix for an attribute with no n 2006-08-21 - By Michael Glavassevich (JIRA)
[ http://issues.apache.org/jira/browse/XERCESJ-1178?page=comments#action _12429337 ] Michael Glavassevich commented on XERCESJ-1178: -----------------------------------------------
I just committed your patch. It looks pretty good though I did run into a couple problems when I tried running with the changes. The stack in the namespace context was underflowing because it wasn't pushing on the start of the root element. I "fixed" that by ensuring that the ArrayList is always non -null though I'm not sure that's what you were intending to do here.
java.util.EmptyStackException at java.util.Stack.peek(Stack.java:85) at java.util.Stack.pop(Stack.java:67) at org.apache.xerces.stax.NamespaceContextImpl.onEndElement (NamespaceContextImpl.java:79) at org.apache.xerces.stax.DOMXMLStreamReaderImpl.initialElementAttrs (DOMXMLStreamReaderImpl.java:318) at org.apache.xerces.stax.DOMXMLStreamReaderImpl.next(DOMXMLStreamReaderImpl .java:212) at XMLStreamReaderTest.process(XMLStreamReaderTest.java:62) at XMLStreamReaderTest.main(XMLStreamReaderTest.java:31)
The other issue is with the AsyncSAXParser thread. It seems like it never terminates. I noticed that because the JVM wasn't exiting at the end of my test program. I've made it a deamon thread so that the JVM exits but there's still a threading problem there. Perhaps the call to the parse method on the XMLReader never returns?
In the fix that you made in SAXXMLStreamReader.initialElementAttrs() you added a check for duplicate attributes that I didn't understand. A SAX parser already does this well-formedness check. Is there a reason for doing that again in the XMLStreamReader?
> Error getting prefix for an attribute with no namespace > ------------------------------------------------------- > > Key: XERCESJ-1178 > URL: http://issues.apache.org/jira/browse/XERCESJ-1178 > Project: Xerces2-J > Issue Type: Bug > Components: StAX > Affects Versions: 2.8.0 > Reporter: Lucian Holland > Assigned To: Michael Glavassevich > Attachments: stax_patch_8.19.zip > > > The initialElementAttrs() method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in.
-- 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: j-dev-unsubscribe@(protected) For additional commands, e-mail: j-dev-help@(protected)
|
|
 |