[jdom-interest] JDOM and a servlet example

joan joan13500 at yahoo.com
Fri Aug 11 11:39:15 PDT 2000


thanks to people who respond to my question,
I new in Java programming but I know well xml and xslt

In fact, it would be usefull for me to find a complete example of using JDOM
with a servlet.
I'm sure it's not very different than using it on command line but after
many tries I'm not able to convert
the Jdom examples in servlets...

May someone write for me a very simple code (but complete) of how read a
basic xml file (ex: AddressBook.xml) and view it in a browser with a
servlet.

I'm sure all will be very clear for me with a complete example...

here this the AddressBook.xml file I'd like to view in my browser with JDOM:

<?xml version= '1.0'?>
<!DOCTYPE ADDRESSBOOK [
<!ELEMENT ADDRESSBOOK (PERSON)*>
<!ELEMENT PERSON (LASTNAME, FIRSTNAME, COMPANY, EMAIL)>
<!ELEMENT LASTNAME (#PCDATA)>
<!ELEMENT FIRSTNAME (#PCDATA)>
<!ELEMENT COMPANY (#PCDATA)>
<!ELEMENT EMAIL (#PCDATA)>
]>
<ADDRESSBOOK>

  <PERSON>
    <LASTNAME>Miyamato</LASTNAME>
    <FIRSTNAME>Musashi</FIRSTNAME>
    <COMPANY>Bushido, Inc.</COMPANY>
    <EMAIL>katana at bushido.com</EMAIL>
  </PERSON>

  <PERSON>
    <LASTNAME>Einstein</LASTNAME>
    <FIRSTNAME>Albert</FIRSTNAME>
    <COMPANY>Hasta Proton, Inc.</COMPANY>
    <EMAIL>hasta at proton.com</EMAIL>
  </PERSON>

  <PERSON>
    <LASTNAME>Hampton</LASTNAME>
    <FIRSTNAME>Ed</FIRSTNAME>
    <COMPANY>AMAC, Inc.</COMPANY>
    <EMAIL>energy at hsingi.com</EMAIL>
  </PERSON>

  <PERSON>
    <LASTNAME>wer</LASTNAME>
    <FIRSTNAME>werwer</FIRSTNAME>
    <COMPANY>wer</COMPANY>
    <EMAIL>erwer</EMAIL>
  </PERSON>

</ADDRESSBOOK>





More information about the jdom-interest mailing list