This is a "has anybody ever seen this?" post.
Occasionally, we'll have a situation where our transformed xml -> html will appear, for example, like this:
<a href="<?xml%20version=%221.0%22%20encoding=%22UTF-8%22?>">Some text</a>
Now, there wasnt any magic in our xsl:
<xsl:template match="a">
<a><xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute><xsl:apply-templates/></a>
</xsl:template>
It doesn't only happen for a tags -- it also happens with others, such as img src attributes.
Some notes:
In the code, when the above symptom is spotted, I've tried throwing out the Templates object we've cached, so that the next thread will create a new one; however, the problem does not go away until the system is restarted.
Since this in an intermittent issue, I suspected that there could be some concurrency issue. Our app server will have numerous threads running at the same time doing transformations, so I made sure our code followed the pattern on the multithreading documentation on xml.apache.org/xalan-j/, as well as the additional synchronization of calling TransformerFactory.newInstance and <instance>.newTemplates. If anyone thinks posting my code or full xsl would be useful I will do so.
We're running Xalan 2.4.1 w/ packaged Xerces 2.2. (although this has happened with every version of Xalan we've run, going back to at least 2.1) and JDK 1.2.1_04.
Any suggestions?
Thanks, Alex
