[opencms-dev] /* Read a XML file, get nodes and create pages...

Wils wilson.neto at cesar.org.br
Thu May 18 21:20:55 CEST 2006


Dear,

I am trying read a full xml file:

<?xml version="1.0" encoding="iso-8859-1"?>
<MEDIAS records="762">
 <MEDIA>
  <ID>166</ID>
  <TITLE>BANQUETE</TITLE>
  <TITLE_ORIG>BANQUETE</TITLE_ORIG>
  <DIRECTION></DIRECTION>
  <CAST></CAST>
  <SYNOPSIS></SYNOPSIS>
  <NATIONALITY>Afeganistão</NATIONALITY>
  <YEAR></YEAR>
  <DURATION>8</DURATION>
  <CLASSIFICATION>1</CLASSIFICATION>
  <MEDIA_TYPE>DIGITAL</MEDIA_TYPE>
 </MEDIA>
 <MEDIA>
  <ID>231</ID>
  <TITLE>O Exterminador do Futuro 3</TITLE>
  <TITLE_ORIG>Terminator 3</TITLE_ORIG>
  <DIRECTION>Jonathan Mostow</DIRECTION>
  <CAST>Arnold Schwarzenegger, Nick Stahl, Claire Danes, Kristanna Loken, David Andrews, Mark Famiglietti, Earl Boen, Moira Harris</CAST>
  <SYNOPSIS>Uma nova Terminatrix vem do futuro com o mesmo objetivo do robô anterior: matar John Connor, líder da humanidade, agora sem a mãe e namorando uma veterinária</SYNOPSIS>
  <NATIONALITY>Estados Unidos</NATIONALITY>
  <YEAR>2003</YEAR>
  <DURATION>1</DURATION>
  <CLASSIFICATION>1</CLASSIFICATION>
  <MEDIA_TYPE>DIGITAL</MEDIA_TYPE>
 </MEDIA>
</MEDIAS>

I have this code:


CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);

String filename   = request.getParameter("filename"); 

String content = "[nothing read]";


//CmsXmlContent myXmlContent = CmsXmlContentFactory.unmarshal(cms,  resource, request);

CmsFile configFile = cmsObject.readFile(filename);
CmsXmlContent config = CmsXmlContentFactory.unmarshal(cmsObject, configFile);

String varX = config.getStringValue(cmsObject,xPath,locale);


I cant think in the form to read this file and display the contents em lines...

Someone help me?

Tks
Wils
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060518/d4f61bac/attachment.htm>


More information about the opencms-dev mailing list