[ http://issues.apache.org/jira/browse/XERCESJ-1178?page=all ]

hua lei updated XERCESJ-1178:
-----------------------------

    Attachment: stax_patch_8.20.zip

The stack underflowing is fixed. 

>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 daemon 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 two cases, the AsyncSAXParser thread will not teminate. 
1) There is an exception occures in the SAXXMLStreamReaderImpl
2) The user doesn't parse the document to the end 

To make sure the AsyncSAXParser thread terminates correctly, following 
modifications are done.
1)  When an exception occurs in the next() method the AsyncSAXParser thread is 
interrupted, because after that no call to the StreamReader is valid. 
2)  When an exception occures in other methods of StreamReader, a call to 
StreamReader may still be valid, so the AsyncSAXParser thread shouldn't be 
interrupted in this case. 
3) In the close() method, if the AsyncSAXParser thread is still alive, 
interrupt it.
But if the user doesn't close the StreamReader after using it, the 
AsyncSAXParser thread may never terminate. So user should call the close() 
method. 


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

The SAX parser cann't recognize the element such as  "<root xmlns:a='xxx' 
xmlns:b='xxx' a:attr='1' b:attr='2' />", so I  check it myself. 



> 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, stax_patch_8.20.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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to