I am reverting a change I did long time ago to this file. I am restoring the logic in this file, that was in the original revision 906803. I think, the original code that I had changed in this file is not really wrong. I started looking at the code in this file, while studying the bug report XERCESJ-1669.