I have an XML Document in a format like:
<Variable name="Bob">ABCD EFG</Variable>
<Variable name="Steve">QW ERTYUI</Variable>
<Variable name="John">POI UYTR</Variable>
<Variable name="Tim">ZXCV BNM</Variable>
<Function id="1">
<Parameter type="String">B ob</Parameter>
<Parameter type="String">S teve</Parameter>
</Function>
<Function id="2">
<Parameter type="String">J ohn</Parameter>
<Parameter type="String">T im</Parameter>
</Function>
I am fairly new to doing transformations with XSLT, but so far I
haven't had luck in solving this problem. All I would like to do is
create a new XML output file where the variable declarations are gone,
and the actual values (like ABCDEFG) substituted for the names ("Bob")
for the "parameters ." So basically I want the output to be:
<Function id="1">
<Parameter type="String">A BCDEFG</Parameter>
<Parameter type="String">Q WERTYUI</Parameter>
</Function>
<Function id="2">
<Parameter type="String">P OIUYTR</Parameter>
<Parameter type="String">Z XCVBNM</Parameter>
</Function>
I tried some of the code samples I found on the net regarding find and
replace routines, but I wasn't able to adapt them to this particular
problem.
Thanks in advance!
<Variable name="Bob">ABCD EFG</Variable>
<Variable name="Steve">QW ERTYUI</Variable>
<Variable name="John">POI UYTR</Variable>
<Variable name="Tim">ZXCV BNM</Variable>
<Function id="1">
<Parameter type="String">B ob</Parameter>
<Parameter type="String">S teve</Parameter>
</Function>
<Function id="2">
<Parameter type="String">J ohn</Parameter>
<Parameter type="String">T im</Parameter>
</Function>
I am fairly new to doing transformations with XSLT, but so far I
haven't had luck in solving this problem. All I would like to do is
create a new XML output file where the variable declarations are gone,
and the actual values (like ABCDEFG) substituted for the names ("Bob")
for the "parameters ." So basically I want the output to be:
<Function id="1">
<Parameter type="String">A BCDEFG</Parameter>
<Parameter type="String">Q WERTYUI</Parameter>
</Function>
<Function id="2">
<Parameter type="String">P OIUYTR</Parameter>
<Parameter type="String">Z XCVBNM</Parameter>
</Function>
I tried some of the code samples I found on the net regarding find and
replace routines, but I wasn't able to adapt them to this particular
problem.
Thanks in advance!
Comment