[xml] Adding <script> element with JavaScript Content



Assuming I have a xmlNodePtr that points to my <head> element node, how do I go about adding nodes that are equivalent to the following XHTML?

<script type="text/javascript">
    <![CDATA[
    var ConfigInfoJsonString_ = "{ 'showBuyButton': false,
        'showTryButton': true, 'textImageOverlapPixels': 100 }";
    ]]>
</script>

The actual content isn't important, but I do want to insert script code into the tree, and I don't see how to do it.

Any help would be greatly appreciated.

Thanks,
Rush



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]