public void createTag(String[] var1, ResultList result, Container container) throws StreamTransformationException{
try
{
//Parser that produces DOM object trees from XML content
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
//API to obtain DOM Document instance
DocumentBuilder builder = null;
//Create DocumentBuilder with default configuration
builder = factory.newDocumentBuilder();
//Parse the content to Document object
Document doc = builder.parse(new InputSource(new StringReader(var1[0])));
//get all children nodes of the node item_source
NodeList childNodes=doc.getDocumentElement().getChildNodes();
// Now selectively move the contents of nodes S1,S2,S3 and S4 to target node
for(int i=0;i<childNodes.getLength();++i)
{
if(childNodes.item(i).getNodeType()==Node.ELEMENT_NODE)
{
result.addValue(childNodes.item(i).getTextContent());
}
}
}
catch(Exception e)
{
throw new StreamTransformationException(e.getMessage());
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 |