Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/03/2012, 08:51
Alberto_Mad
 
Fecha de Ingreso: febrero-2010
Mensajes: 37
Antigüedad: 15 años, 2 meses
Puntos: 0
Representación XML

Buenas tardes,

estoy realizando un aplicación la cuestión es que tiene que mostrar un XML, pero la cosa es que muestra los datos pero sin las etiquetas XML atribuidas.

Adjunto un trozo de código:
Código JAVA:
Ver original
  1. ...
  2. XMLSerializer xmlSerializer = new XMLSerializer();
  3. StringWriter strWriter = new StringWriter();
  4. OutputFormat outFormat = new OutputFormat();
  5.  
  6. //outFormat.setEncoding(XML_ENCODING);
  7. //outFormat.setVersion(XML_VERSION);
  8. outFormat.setEncoding("UTF-8");
  9. outFormat.setVersion("1.0");
  10. outFormat.setIndenting(true);
  11. //outFormat.setOmitXMLDeclaration(true);
  12. outFormat.setIndent(4);
  13. outFormat.setOmitXMLDeclaration(false);
  14. outFormat.setLineSeparator( "<br>" );
  15. outFormat.setMethod("xml");
  16.  
  17.  
  18. xmlSerializer.setOutputCharStream(strWriter);
  19. xmlSerializer.setOutputFormat(outFormat);
  20. xmlSerializer.serialize(xmlDoc);
  21. strWriter.close();
  22.  
  23. varAux = strWriter.toString();
Qué opción necesitaría para que el String que muestra, muestre todas las etiquetas que contiene el XML y no solamente los datos.

Adjunto un trozo de la salida de dicho XML:

Código out:
Ver original
  1. ...
  2.  
  3. NUMERO DE RESULTADOS
  4. es
  5.  
  6.  
  7. web
  8. http://filosofia.idoneos.com/index.php/363297
  9. Miguel de <b>Unamuno</b> (1864-1936)
  10. existencialismo - <b>unamuno</b> - kierkegaard - spinoza - philosophy - especulacion - metafisica - gnoselogia - conocimiento <b>...</b> Cuando <b>Aristóteles</b> criticaba a Platón <b>...</b>
  11.  
  12. ...

Muchas gracias.