Hi Tim,
I must confess I haven't run your full example, but you'll probably
need to explicitly specify the namespace of your script element, as
shown in the following two function calls:
file:write("result.xml",
<xml xmlns="http://www.w3.org/1999/xhtml">
<script> < </script>
</xml>,
<output:serialization-parameters>
<output:method
value="xhtml"/>
<output:cdata-section-elements
value="Q{{http://www.w3.org/1999/xhtml}}script"/>
</output:serialization-parameters>
)
file:write("result.xml",
<xml xmlns="http://www.w3.org/1999/xhtml">
<script> < </script>
</xml>,
map {
'cdata-section-elements':
'Q{http://www.w3.org/1999/xhtml}script'
}
)
Otherwise, the CDATA section does only apply to the empty namespace:
file:write("result.xml",
<xml xmlns="http://www.w3.org/1999/xhtml">
<script xmlns=""> < </script>
</xml>,
map { 'cdata-section-elements': 'script' }
)
Regarding your second question:
(: Does this work? :)
%output:cdata-section-elements("script")
Yes, that's indeed a valid way to specify serialization parameters.
Hope this helps,
Christian