Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

get/write from XML.

Thread view: 
Eitan M - 19 Aug 2007 13:56 GMT
Hello.

How can I read neither write from XML ?
(using XMLDOM).

Need sample, please.

Thanks :)
Jeff Higgins - 19 Aug 2007 15:56 GMT
> Hello.
>
> How can I read neither write from XML ?
> (using XMLDOM).
>
> Need sample, please.

<http://www.cafeconleche.org/books/xmljava/>
Eitan M - 20 Aug 2007 07:08 GMT
Thanks...

How can I write to XML, but using it like ini file.

What I mean : when writting to XML - if a node doesn't exists (or the XML
doesn't exists) : write it automatically ?
Also - when reading from XML : get a default value, if value not exists ?

Thanks :)
Andrew Thompson - 20 Aug 2007 08:08 GMT
It would really help people to help you, if you sum
up in your initial post "I want to offer X to the end user"
where X is some feature.  ..because *

>How can I write to XML, but using it like ini file.

..your first post stated 'using XMLDom' or WTE,
whereas it seems you just want to achieve some
particular end.

* Note that I would still like to know what it is you
intend to offer to the end user, because that is
still not clear to me, and I (and presumably others)
cannot 'guess' what is the best strategy to achieve
the ..we don't know *what* you are trying to achieve.

>What I mean : when writting to XML - if a node doesn't exists (or the XML
>doesn't exists) : write it automatically ?
>Also - when reading from XML : get a default value, if value not exists ?

XMLEncoder/XMLDecoder does this for any Java Object
that is (effectively) a bean, a class that provides getters
and setters for the public attributes, possibly default
values, and a 'no args' constructor.

Searching the group for 'XMLEncoder' or similar for code
samples.

But it is not 'XMLDom', so the question comes back to.  

What is 'X'?

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Eitan M - 22 Aug 2007 08:03 GMT
...

XMLEncoder/XMLDecoder read the XML sequentially
(XMLDecoder.readObject()).
What I need is reading the XML by element name, and not at the order that
the components appear on screen.

Thanks :)
Eitan M - 22 Aug 2007 13:55 GMT
... should I use xmldom with xmlpath for that, or it may be simplier ?

Thanks :)
Jeff Higgins - 20 Aug 2007 12:06 GMT
> Thanks...
>
[quoted text clipped - 3 lines]
> doesn't exists) : write it automatically ?
> Also - when reading from XML : get a default value, if value not exists ?

<http://commons.apache.org/digester/>
Roedy Green - 22 Aug 2007 09:37 GMT
On Sun, 19 Aug 2007 15:56:56 +0300, "Eitan M"
<nospam@nospam_please.com> wrote, quoted or indirectly quoted someone
who said :

>Need sample, please.

see http://mindprod.com/jgloss/xml.html
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.