Skip to Content
avatar image
Former Member

Xml file problems to update

hello experts i have a problem to update my xml file in mime folder im using resourcepath to generate the url then write it in.

so i have an iframe that load an html file in mime folder too. but this html show the xml file content but not show the last changed

can you help me pls !

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 31, 2014 at 06:51 PM

    who told you that the xml canĀ  be updated?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      i make the changes in the xml file using webdynpro:

      xmlUrl = WDURLGenerator.getResourcePath

      (wdComponentAPI.getComponent().getDeployableObjectPart(), "NOTICIAS/xml/eboseNews.xml"); DocumentBuilderFactory factory; factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); DocumentBuilder builder = factory.newDocumentBuilder(); Document xmldoc = builder.parse(xmlUrl); xmldoc.getDocumentElement().normalize(); //NUEVO NODO HIJO DE CHANEL Element itemElement = xmldoc.createElement("item"); IPublicFormularioCust.ICabNoticiaElement elemCab = wdContext.currentCabNoticiaElement();       //NODOSS HIJOS DE ITEM Element titleElement = xmldoc.createElement("title"); titleElement.appendChild(xmldoc.createCDATASection(elemCab.getTitulo().trim())); Element linkElement = xmldoc.createElement("link"); linkElement.appendChild(xmldoc.createCDATASection("docs/" + elemCab.getLink().getResourceName().trim())); Element descripElement = xmldoc.createElement("description"); descripElement.appendChild(xmldoc.createCDATASection(elemCab.getDescripcion().trim())); Element categoryElement = xmldoc.createElement("category"); categoryElement.appendChild(xmldoc.createCDATASection(elemCab.getCategoria().trim())); Element pubdateElement = xmldoc.createElement("pubDate"); pubdateElement.appendChild(xmldoc.createCDATASection(new SimpleDateFormat("dd/MM/yyyy").format(Constantes.FECHACTUAL))); //AGREGANDO NODOS HIJOS A ELEMENTO ITEM itemElement.appendChild(titleElement); itemElement.appendChild(linkElement); itemElement.appendChild(descripElement); itemElement.appendChild(categoryElement); itemElement.appendChild(pubdateElement); //AGREGANDO ELEMENTO ITEM Node channelNode = xmldoc.getDocumentElement().getElementsByTagName("channel").item(0); channelNode.insertBefore(itemElement, xmldoc.getElementsByTagName("item").item(0)); //Serializando el XMLDOC en un StringWriter xmlSerializer.serialize(xmldoc); FileWriter fw = new FileWriter(new File(xmlUrl)); fw.write(sw.toString());

      so later i can see the changes but when i reloaded the page dont appear the changes only have the information when i deployed the project. This xml is show in with javascript. This javascript belongs to html file that is loaded into a iframe.

  • avatar image
    Former Member
    Jan 06, 2015 at 09:43 AM

    Hi, How you are reading xml file from  HTML.

    Add comment
    10|10000 characters needed characters exceeded