well, i couldn't make sense of it, so i modified it a bit.
it's kind of rough, but with this you can search for tags in the xml and it takes the text content of those tags and puts them in a string.
i commented it heavily, so you can reuse it for your own purposes.
i didn't attempt the write button, bc i still cant understand what you want to write.
good luck.
<abs contexttype="opengear">
<meta>
<params>
<param access="1" constrainttype="INT_NULL" name="elementsFound" oid="elementsFound" precision="0" type="INT16" value="4" widget="default"/>
<param access="1" maxlength="0" name="finalReturnedXML" oid="finalReturnedXML" precision="0" type="STRING_ARRAY" value="1;2;3;4" widget="default">
<value>1</value>
<value>2</value>
<value>3</value>
<value>4</value>
</param>
<param access="1" maxlength="0" name="returnedString" oid="returnedString" type="STRING" value=" 1, 2, 3, 4, " widget="text"/>
<param access="1" maxlength="0" name="searchString" oid="searchString" type="STRING" value="num" widget="text"/>
<param access="1" maxlength="0" name="xmlPath" oid="xmlPath" type="STRING" value="C:/DashBoard/Practice_Panel_01/BaseballDan/baseballDan.xml" widget="default"/>
</params>
</meta>
<abs bottom="20" id="canvasMain" left="0" right="0" scroll="true" top="0">
<param expand="true" height="60" left="128" oid="string1" showlabel="false" top="387" width="420"/>
<button buttontype="push" height="80" id="buttRead1" left="20" name="Read 1" top="40" width="200">
<task tasktype="ogscript">var xmlPathVar = params.getValue('xmlPath', 0); //this variable holds the user defined path
var extPath = "file:///"; //this defines that the string is a FILE, not a web address
xmlPath = extPath + xmlPathVar; //this appends the two above variables
var testXML = ogscript.parseXML(xmlPath); //this variable stores all the parsed xml in Dashboard
// check parse worked
if (testXML == null) {
// if parse failed debug msg
ogscript.debug('Failed to read file');
} else {
// if parse worked
ogscript.debug('Parsing XML');
var searchTag = params.getValue('searchString', 0); //this sets the search string
var dataTags = testXML.getElementsByTagName(searchTag); // seperates the testXML data by the searchTag(s) in an array called dataTags.
if (dataTags.length == 0)
{
// if parse failed debug msg
ogscript.debug('Failed to find that tag');
} else {
ogscript.debug("items found: " + dataTags.length); // degub msg dataTags array length
params.setValue('elementsFound', 0, dataTags.length); // set param, elementsFound, to dataTags length
var myString = " "; //create an empty string to later add our results to
// loop through dataTags array and return only text content in new array,
for (xmlData = 0; xmlData < dataTags.length; xmlData++) {
var node = dataTags.item(xmlData); //making variable of the current node for this loop through the dataTags array
var xmlDataTagsText = node.getTextContent(); // making variable for the Text Content in this node
ogscript.debug("No. " + xmlData + " contains: " + xmlDataTagsText); // debug msg for Text value returned
params.setValue('finalReturnedXML', xmlData, xmlDataTagsText); // set a finalReturnedXML param value for text returned in dataTag
myString += xmlDataTagsText + ', '; //appending current node's text content to our outputstring
}
params.setValue('returnedString', 0, myString); //output string to output textbox
}
}</task>
</button>
<button buttontype="push" height="80" id="buttWrite1" left="240" name="Write 1" top="40" width="200"/>
<table height="60" left="20" oid="pathPlayersHome" top="220" width="840">
<tr>
<label anchor="east" fill="none" insets="0,0,0,5" name="xml path" weightx="0.0"/>
<param anchor="west" expand="true" fill="both" oid="xmlPath" showlabel="false" weightx="1.0" weighty="1.0"/>
</tr>
</table>
<param expand="true" height="60" left="128" oid="string1" showlabel="false" top="304" width="420"/>
<param expand="true" height="74" left="133" oid="searchString" top="298" width="384"/>
<param expand="true" height="68" left="138" oid="returnedString" top="399" width="380"/>
</abs>
<label anchor="east" fill="none" height="18" insets="0,0,0,5" left="27" name="search tag" top="329" weightx="0.0" width="103"/>
<label anchor="east" fill="none" height="18" insets="0,0,0,5" left="28" name="results" top="428" weightx="0.0" width="103"/>
</abs>
#DashBoard