stevedlawrence opened a new pull request, #905:
URL: https://github.com/apache/daffodil/pull/905

   Currently, when mixed content is found when unparsing with the SAX API, the 
DaffodilUnparseContentHandler throws an IllegalContentWhereEventExpected 
exception. This has two issues:
   
   1. A SAX XMLReader API only expects SAXExceptions to be thrown from a 
ContentHandler
   2. Throwing the exception here ends execution of the ContentHandler 
subroutine without signaling the unparse() subroutine/thread. This means the 
unparse thread is deadlocked waiting for more events that will never come.
   
   To solve these issues, instead of throwing the exception, this just adds the 
mixed content string to the current SAXInfosetEvent. When the 
SAXInfosetInputter reads that event and sees the mixed content, it will throw 
the IllegalContentWhereEventExpected exception. This is now thrown in he 
unparse thread, which causes the unparse thread to stop unparsing and create an 
UnparseResult, send it to the ContentHandler thread, and cleanly exit. The 
ContentHandler thread can then receive the UnparseResult and convert it to a 
SAXException.
   
   Also update a number of comments to make certain sections more clear.
   
   DAFFODIL-2767


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to