I am sitting on a little problem here:
I have a php file which generates xml data.
$requestXmlBody .= "<Version>$compatabilityLevel</Version>";
Now there are variables pulled from the upper php code and also HTML is generated
$requestXmlBody .=
'<Description>
<![CDATA[
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script type="text/javascript">
<!--some JS-->
</script>
<img src="http://www.myserver.com/pic.jpg" class="etalage_thumb_image" />
</body>
</html>
]]>
</Description>';
Now strangely I cannot mix variables and HTML Code. As you can see I use CDATA for the HTML. I want to use a variable for the image name rather than a fixed link. So the code would look like this
$requestXmlBody .= '<Description>
<![CDATA[
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script type="text/javascript">
<!--some JS-->
</script>
<img src="$imagelink" class="etalage_thumb_image" />
</body>
</html>
]]>
</Description>';
But this just does not work. I tried this
$requestXmlBody .= '<Description>
<![CDATA[
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script type="text/javascript">
<!--some JS-->
</script>
<img src="]]>$imagelink<![CDATA[" class="etalage_thumb_image" />
</body>
</html>
]]>
</Description>';
But also this will not work. I even tried to hand over the php variable (which I grab from a session btw) to a JS variable and include it with document.write
Still no success.
This one would work
$requestXmlBody .= '<Description>
$imagelink
</Description>';
But not together with the generated HTML code as you can see above.
Any help is appreciated.
Thanks