<xsl:for-each select="ColumnName">
<span>
<script type="text/javascript">document.write("thisStringIsGood".replace(/([A-Z])/g, ' $1').replace(/^./, function(str){ return str.toUpperCase(); }));</script>
</span>
</xsl:for-each>
此代码抛出错误:
InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable
在常规html中尝试相同的工作
<span>
<script type="text/javascript">document.write("thisStringIsGood".replace(/([A-Z])/g, ' $1').replace(/^./, function(str){ return str.toUpperCase(); }));</script>
</span>