lyndonwong
09-17-2003, 08:34 PM
Hi Laszlo, I'm trying to set parameters of an .lzx app using an external XML datasource.
Let's say I want to determine the color of some text by reading an XML parameter list such as:
pWeather_parameters.xml -----------------------------
<parameters>
<titleColor>#CCCCFF</titleColor>
</parameters>
To use that in an .lzx app, I declare a dataset:
<!-- App parameter values in an external XML file -->
<dataset name="pWeather_parameters" src="pWeather_parameters.xml" />
I can read the above titleColor parameter successfully with the following code, which displays the string "#CCCCFF":
<view name="externalText" datapath="pWeather_parameters:/parameters/">
<text fontsize="12" width="170" datapath="titleColor/text()" />
But how would I access the same above titleColor parameter and assign it to the fgcolor attribute of another text string?
<text fontsize="12" width="170" fgcolor="${parent.externalText.titleColor/text()}">This should be the fgcolor!</text>
I bumbled with a few attempts but failed. Can you steer me toward the right approach? -- thanks.
Let's say I want to determine the color of some text by reading an XML parameter list such as:
pWeather_parameters.xml -----------------------------
<parameters>
<titleColor>#CCCCFF</titleColor>
</parameters>
To use that in an .lzx app, I declare a dataset:
<!-- App parameter values in an external XML file -->
<dataset name="pWeather_parameters" src="pWeather_parameters.xml" />
I can read the above titleColor parameter successfully with the following code, which displays the string "#CCCCFF":
<view name="externalText" datapath="pWeather_parameters:/parameters/">
<text fontsize="12" width="170" datapath="titleColor/text()" />
But how would I access the same above titleColor parameter and assign it to the fgcolor attribute of another text string?
<text fontsize="12" width="170" fgcolor="${parent.externalText.titleColor/text()}">This should be the fgcolor!</text>
I bumbled with a few attempts but failed. Can you steer me toward the right approach? -- thanks.