| CallXML 2.0 Development Guide | Home | Frameset Home |
|
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="2.0">
<block label="pound">
<text>you pressed the pound key.</text>
</block>
</callxml>
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="2.0">
<block label="star">
<text>you pressed the star key.</text>
</block>
</callxml>
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="2.0">
<block>
<playAudio value="helloworld.wav"
termdigits="*#"/>
<ontermdigit value="*">
<goto value="helloworld-star.xml"
submit="*"
method="get"/>
</ontermdigit>
<ontermdigit value="#">
<goto value="helloworld-pound.xml"
submit="*"
method="get"/>
</ontermdigit>
</block>
</callxml>
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="2.0">
<block>
<playAudio value="helloworld.wav"
termdigits="*#"/>
<ontermdigit value="*">
<goto value="helloworld-handler.php?key=star" submit="*" method="get"/>
</ontermdigit>
<ontermdigit value="#">
<goto value="helloworld-handler.php?key=pound" submit="*" method="get"/>
</ontermdigit>
</block>
</callxml>
<?PHP
?> indicates the end of the block.
$s = $HTTP_GET_VARS["key"];
echo "<?xml version="\1.0\" encoding=\"UTF-8\" ?> ";
echo "<callxml version=\"2.0\"> ";
echo " <block label=\" $s \"> ";
if ($s == "star") {
echo " <text>you pressed the star key.</text> ";
} else {
echo " <text>you pressed the pound key.</text> ";
}
echo " </block> ";
echo "</callxml>";
?>
<?PHP
$s = $HTTP_GET_VARS["key"];
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> ";
echo "<callxml version=\"2.0\"> ";
echo " <block label=\" $s \"> ";
if ($s == "star") {
echo " <text>you pressed the star key.</text> ";
} else {
echo " <text>you pressed the pound key.</text> ";
}
echo " </block> ";
echo "</callxml>";
?>
| ANNOTATIONS: EXISTING POSTS |
vsefcik
|
|
| The above sample won't work because the first 3 echo statements enclose the XML in quotation marks. If the lines are changed from:
echo "<?xml version="1.0" encoding="UTF-8" ?> "; echo "<callxml version="2.0"> "; echo " <block label=" $s "> "; to echo '<?xml version="1.0" encoding="UTF-8" ?> '; echo '<callxml version="2.0"> '; echo ' <block label=" $s "> '; the code will work correctly. |
|
MattHenry
|
|
|
Hiya Vincent, Yyet another instance of my docs having a misleading typo; I really should be more careful, as this could mislead the heck out of folks. Thanks for catching this for me; I'll have this corrected soon! ~Matthew Henry |
|
bryanaamot
|
|
| Technically speaking, it is a good idea to specify the content type like this:
header('Content-Type: text/xml'); Note: This must appear before any other text is output. |
| login |
|