12-04-2019 07:17 AM
Hi,
I've got an inherited piece of software that generates an XML file that I cannot change the parameters of, that will sometimes contain a single waveform or occasionally a multipulse waveform (Pulse 0 or Pulse 0 AND Pulse 1).
I am using the XML as a template, and I can open it, edit the node values for Pulse 0 fine. I have added in code to list the nodes and determine if Pulse 1 is present, which works fine. However, the pulses have the same node names e.g. Pulse 0 and Pulse 1 both have a node called 'DelayTime', so when my code executes, it updates Pulse 0 correctly, finds Pulse 1 is present and then overwrites the values for Pulse 1 into Pulse 0.
Any advice/guidance would be appreciated. XMLs are attached in the zip.
Thank you.
12-04-2019 08:38 AM
Your code just verify if there is a Pulse node with a name attribute equal to Pulse 1 and update the fist Pulse node if one is found. You should explicitly search for a Pulse node with the Name attribute Pulse 1 using the following xpath expression:
/Waveform/PulseManager/Pulse[@Name='Pulse 1']
… and you could do the same thing for Pulse 0.
Ben64