public Document String2DOM(String s)
{
Document tmpX=null;
DocumentBuilder builder=null;
try{
DocumentBuilderFactory dbFactory = new DocumentBuilderFactoryImpl();
builder = dbFactory.newDocumentBuilder();
}catch(javax.xml.parsers.ParserConfigurationException error){
return null;
}
try{
tmpX=builder.parse(new ByteArrayInputStream(s.getBytes()));
}catch(org.xml.sax.SAXException error){
return null;
}catch(IOException error){
return null;
}return tmpX;
}
Filed under: Proyecto Fin de Carrera, XML | Leave a Comment
Tags: Document, DOM, String, XML



No Responses Yet to “String2DOM: Función para convertir un String en Document”