in taverna-xpath-activity-ui/src/main/java/org/apache/taverna/activities/xpath/ui/config/XPathActivityConfigurationPanel.java [864:910]
protected void parseXML() {
String xmlData = taSourceXML.getText();
try {
xmlTree = XPathActivityXMLTree.createFromXMLData(xmlData,
miIncludeAttributes.isSelected(), miIncludeValues
.isSelected(), miIncludeNamespaces.isSelected(),
this);
xmlTree
.setToolTipText("<html>This is a tree structure of the XML document that you have pasted.<br><br>"
+ "Clicking on the nodes in this tree will automatically generate a<br>"
+ "corresponding XPath expression. Multiple <b>identical</b> nodes can<br>"
+ "be selected at once - in this case <b>wildcards</b> will be used in the<br>"
+ "generated XPath expression to if selected nodes have different<br>"
+ "ancestors. Other nodes that match the generated XPath expression<br>"
+ "will also be selected in the tree.<br><br>"
+ "Contextual menu provides convenience methods for expanding or<br>"
+ "collapsing the tree." + "</html>");
xmlTree.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
JScrollPane spXMLTree = new JScrollPane(xmlTree);
spXMLTree.setPreferredSize(spXMLTreePlaceholder.getPreferredSize());
jpRight.removeAll();
jpRight.add(spXMLTree);
// all successful - enable options to modify the tree
this.bShowXMLTreeSettings.setEnabled(true);
// data structures inside the XML tree were reset (as the tree was
// re-created) -
// now reset the UI to the initial state as well
resetXPathEditingPanel();
resetXPathTestingPanel();
// XML tree has pre-populated the namespace map with the namespaces
// specified in the
// root element of the tree - load these values
updateXPathEditingPanelValues();
this.validate();
this.repaint();
} catch (DocumentException e) {
JOptionPane.showMessageDialog(this, e.getMessage(),
"XPath Activity", JOptionPane.ERROR_MESSAGE);
this.taSourceXML.requestFocusInWindow();
return;
}
}