Quantcast
Channel: Adobe Community : Popular Discussions - LiveCycle Workbench
Viewing all articles
Browse latest Browse all 69588

get string from XML

$
0
0

I have the following in an execute script. It creates an XML quite nicely. However, I need it to retrieve the data for comparison versus creating an XML. Is there an easy way to convert what I have so this can be accomplished? I need to compare the commonName to a string value that will be static, and store the userId that corresponds to it as a string. 

 

 

DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
DocumentBuilder bd = fact.newDocumentBuilder();
Document doc = bd.newDocument();
Element root = (Element) doc.createElement("users");
doc.appendChild(root);

if(userlist != null)
{
Iterator iterator = userlist.iterator();
while ( iterator.hasNext() )
{
  User eachUser = (User)iterator.next();

  Element UserNode = doc.createElement("user");

  Element ValueNode = doc.createElement("userID");
  ValueNode.appendChild(doc.createTextNode(eachUser.userId));
  UserNode.appendChild(ValueNode);

 

  Element ValueNode = doc.createElement("commonName");
  ValueNode.appendChild(doc.createTextNode(eachUser.commonName));
  UserNode.appendChild(ValueNode);

  root.appendChild(UserNode);
}
}
patExecContext.setProcessDataValue("/process_data/uXML", (Object)doc)


Viewing all articles
Browse latest Browse all 69588

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>