TNO
08-13-2008, 08:01 PM
In my XML file I have a custom tag:
<TNO:FOO />
My XSL transforms it into something like this:
<xsl:template match="TNO:FOO">
<script type="text/javascript">
var badPractice = true;
</script>
<div id="title">
<xsl:value-of select="./@text"/>
</div>
</xsl:template>
The problem with this is obvious..I'll have <script> blocks all over the body where they shouldn't be. How would I go about getting that script tag into the head or manipulating a script tag that already exists there? Is it possible to manipulate a transformation during the transformation?
<TNO:FOO />
My XSL transforms it into something like this:
<xsl:template match="TNO:FOO">
<script type="text/javascript">
var badPractice = true;
</script>
<div id="title">
<xsl:value-of select="./@text"/>
</div>
</xsl:template>
The problem with this is obvious..I'll have <script> blocks all over the body where they shouldn't be. How would I go about getting that script tag into the head or manipulating a script tag that already exists there? Is it possible to manipulate a transformation during the transformation?