  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Modify an xml thru JDOM | Modify an xml thru JDOM 2006-02-15 - By Roberto Marra
Back Hi guys Im new in this list & new with JDOM, so "hi" to everybody & thanx for your precious comments & helps.
My question is:
Let say that I got an XML file like this one:
<?xml version="1.0" encoding="ISO-8859 (See http://ISO-8859.ora-code.com)-1"?> <righeOrdine nrOrd="1"> <id art="292"> <sequenza>1.1</sequenza> <codice>110061</codice> <descrizione>PET FILM CORONA OUTSIDE</descrizione> <tipologia>PTR</tipologia> <trattamento>CR2</trattamento> </id> <id art="293"> <sequenza>2.1</sequenza> <codice>110071</codice> <descrizione>PET PVDC COATED</descrizione> <tipologia>PTR</tipologia> <trattamento>PC1</trattamento> </id> </righeOrdine>
what I would like to do is thru JDOM update just some value of the <id art="293 ">, let say I would update the "codice" from 110071 to 112071. Im sure is possible to do that, can you just suggest me some tips&tricks to do it? (of course using java)
Any help is appriciated
Cheers Roberto
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <META content="MSHTML 6.00.2800.1528" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face="Trebuchet MS">Hi guys Im new in this list & new with JDOM, so "hi" to everybody & thanx for your precious comments & helps.</FONT></DIV> <DIV><FONT face="Trebuchet MS"></FONT> </DIV> <DIV><FONT face="Trebuchet MS">My question is:</FONT></DIV> <DIV><FONT face="Trebuchet MS"></FONT> </DIV> <DIV><FONT face="Trebuchet MS">Let say that I got an XML file like this one:</FONT></DIV> <DIV><FONT face="Lucida Sans Unicode"></FONT> </DIV> <DIV><FONT face="Lucida Sans Unicode"><FONT face=Courier size=1><?xml version="1.0" encoding="ISO-8859 (See http://ISO-8859.ora-code.com)-1"?><BR><righeOrdine nrOrd="1"><BR> <id art="292"><BR> <sequenza>1.1</sequenza><BR> <codice>110061</codice><BR> <descrizione>PET FILM CORONA OUTSIDE</descrizione><BR> <tipologia>PTR</tipologia ><BR> <trattamento>CR2</trattamento><BR> </id ><BR> <id art="293"><BR> <sequenza>2.1</sequenza><BR> <codice>110071</codice><BR> <descrizione>PET PVDC COATED</descrizione><BR> <tipologia>PTR</tipologia> ;<BR> <trattamento>PC1</trattamento><BR> </id> <BR></righeOrdine></FONT></FONT></DIV> <DIV><FONT face="Lucida Sans Unicode"><FONT face=Courier size=1></FONT></FONT> </DIV> <DIV><FONT face="Lucida Sans Unicode"></FONT> </DIV> <DIV><FONT face="Trebuchet MS">what I would like to do is thru JDOM update just some value of the <id art="293">, let say I would update the "codice" from 110071 to 112071. Im sure is possible to do that, can you just suggest me some tips&tricks to do it? (of course using java)</FONT></DIV> <DIV><FONT face="Trebuchet MS"></FONT> </DIV> <DIV><FONT face="Trebuchet MS">Any help is appriciated</FONT></DIV> <DIV><FONT face="Trebuchet MS"></FONT> </DIV> <DIV><FONT face="Trebuchet MS">Cheers</FONT></DIV> <DIV><FONT face="Trebuchet MS">Roberto</FONT></DIV> <DIV><FONT face="Trebuchet MS"></FONT> </DIV> <DIV><FONT face="Trebuchet MS"><BR></FONT></DIV> <DIV><FONT face="Trebuchet MS"></FONT> </DIV> <DIV><FONT face="Lucida Sans Unicode"></FONT> </DIV> <DIV><FONT face="Lucida Sans Unicode"> </DIV></FONT></BODY></HTML>
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
|
|
 |