Passing a variable from one xml file to another - (Scope)
Posted: Tue Feb 20, 2007 2:00 pm
Support,
How do I set a Global variable in my "application root" xml file and then reference it in my "leaf" xml file?
1. In the application root I set a global var called "vSubjID" and assign it "0"
2. In the application root I change "vSubjID" inside a form construct
3. I would like to reference this variable in a "leaf" xml file, but it keeps reporting the initial value of "vSubjID?"
4. Clearly I am not properly "assigning" the application root "vSubjID" var.
=============================================
<!-- test3.xml (Application Root) -->
<?xml version="1.0"?>
<vxml version="2.0">
<property name="inputmodes" value="dtmf" />
<var name="vSubjID" expr="0"/>
<!-- Enter Subject ID -->
<form id="frmSubjID">
<block>
<assign name="vSubjID" expr="1289"/>
The Subject ID is now set to <value expr="vSubjID"/>.
<goto next="test4.xml#frmQ001" maxage="0" maxstale="0"/>
</block>
</form>
</vxml>
<!-- test4.xml (Leaf) -->
<?xml version="1.0"?>
<vxml version="2.0" application="test3.xml">
<form id="frmQ001">
<block>
<prompt>
The Subject ID from test three dot ex em el is <value expr="application.vSubjID"/>
</prompt>
</block>
</form>
</vxml>
How do I set a Global variable in my "application root" xml file and then reference it in my "leaf" xml file?
1. In the application root I set a global var called "vSubjID" and assign it "0"
2. In the application root I change "vSubjID" inside a form construct
3. I would like to reference this variable in a "leaf" xml file, but it keeps reporting the initial value of "vSubjID?"
4. Clearly I am not properly "assigning" the application root "vSubjID" var.
=============================================
<!-- test3.xml (Application Root) -->
<?xml version="1.0"?>
<vxml version="2.0">
<property name="inputmodes" value="dtmf" />
<var name="vSubjID" expr="0"/>
<!-- Enter Subject ID -->
<form id="frmSubjID">
<block>
<assign name="vSubjID" expr="1289"/>
The Subject ID is now set to <value expr="vSubjID"/>.
<goto next="test4.xml#frmQ001" maxage="0" maxstale="0"/>
</block>
</form>
</vxml>
<!-- test4.xml (Leaf) -->
<?xml version="1.0"?>
<vxml version="2.0" application="test3.xml">
<form id="frmQ001">
<block>
<prompt>
The Subject ID from test three dot ex em el is <value expr="application.vSubjID"/>
</prompt>
</block>
</form>
</vxml>