Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

RE: [jdom-interest] Modify an xml thru JDOM

William Krick

2006-02-15

Replies:

You're not in the "tips and tricks" stage yet.
 
Read these articles, learn a little, then come back when you are stuck...
 
http://www.javaworld.com/javaworld/jw-05-2000/jw-0518-jdom.html
 
http://www.javaworld.com/javaworld/jw-07-2000/jw-0728-jdom2.html
 
 
-----Original Message-----
From: Roberto Marra [mailto:rmarra@montefiore.ch]
Sent: Wednesday, February 15, 2006 10:31 AM
To: jdom-interest@jdom.org
Subject: [jdom-interest] Modify an xml thru JDOM

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-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
 

 
 
 
_______________________________________________
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.