Java Mailing List Archive

http://www.junlu.com/

Google
Google
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
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Modify an xml thru JDOM

Modify an xml thru JDOM

2006-02-15       - By Roberto Marra

 Back
Reply:     1     2     3  

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 &amp; new with JDOM,
so "hi" to everybody &amp; thanx for your precious comments &amp;
helps.</FONT></DIV>
<DIV><FONT face="Trebuchet MS"></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS">My question is:</FONT></DIV>
<DIV><FONT face="Trebuchet MS"></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face="Lucida Sans Unicode"><FONT face=Courier size=1>&lt;?xml
version="1.0" encoding="ISO-8859 (See http://ISO-8859.ora-code.com)-1"?&gt;<BR>&lt;righeOrdine
nrOrd="1"&gt;<BR>&nbsp;&lt;id
art="292"&gt;<BR>&nbsp;&nbsp;&lt;sequenza&gt;1.1&lt;/sequenza&gt;<BR>&nbsp;
&nbsp;&lt;codice&gt;110061&lt;/codice&gt;<BR>&nbsp;&nbsp;&lt;descrizione&gt;PET
FILM CORONA
OUTSIDE&lt;/descrizione&gt;<BR>&nbsp;&nbsp;&lt;tipologia&gt;PTR&lt;/tipologia
&gt;<BR>&nbsp;&nbsp;&lt;trattamento&gt;CR2&lt;/trattamento&gt;<BR>&nbsp;&lt;/id
&gt;<BR>&nbsp;&lt;id
art="293"&gt;<BR>&nbsp;&nbsp;&lt;sequenza&gt;2.1&lt;/sequenza&gt;<BR>&nbsp;
&nbsp;&lt;codice&gt;110071&lt;/codice&gt;<BR>&nbsp;&nbsp;&lt;descrizione&gt;PET
PVDC
COATED&lt;/descrizione&gt;<BR>&nbsp;&nbsp;&lt;tipologia&gt;PTR&lt;/tipologia&gt
;<BR>&nbsp;&nbsp;&lt;trattamento&gt;PC1&lt;/trattamento&gt;<BR>&nbsp;&lt;/id&gt;
<BR>&lt;/righeOrdine&gt;</FONT></FONT></DIV>
<DIV><FONT face="Lucida Sans Unicode"><FONT face=Courier
size=1></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face="Lucida Sans Unicode"></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS">what I would like to do is thru JDOM update just
some value of the &lt;id art="293"&gt;, 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&amp;tricks to do it? (of course using java)</FONT></DIV>
<DIV><FONT face="Trebuchet MS"></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS">Any help is appriciated</FONT></DIV>
<DIV><FONT face="Trebuchet MS"></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS">Cheers</FONT></DIV>
<DIV><FONT face="Trebuchet MS">Roberto</FONT></DIV>
<DIV><FONT face="Trebuchet MS"></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS"><BR></FONT></DIV>
<DIV><FONT face="Trebuchet MS"></FONT>&nbsp;</DIV>
<DIV><FONT face="Lucida Sans Unicode"></FONT>&nbsp;</DIV>
<DIV><FONT face="Lucida Sans Unicode">&nbsp;</DIV></FONT></BODY></HTML>

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.