Thread: XML with DOM?

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Grand Rapids MI USA
    Posts
    8
    Rep Power
    0

    Question XML with DOM?


    My site is allowing the user to view data from an XML file(s), and I want to prevent the XML from being sent to the client.

    I have been using PHP to convert the XML into HTML, but this is no fun. I hear Java is much nicer to work with for XML conversion.

    Has anyone worked with Java to convert XML to HTML?

    If yes, is it better the PHP?

    Will Java send the XML to the client like XSL or will it pars it out and send the results like PHP?

    Would I use the DOM with Java?

    I am not a Java person (that is probably apparent), but I am willing to learn if it is the best way to go.

    Thank you.
  2. #2
  3. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    538
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    102
    Rep Power
    15

    Thumbs up Java & XML


    The answer to your question (in my opinion) is a definite yes. Java is better at handling XML right now. I have worked with both PHP and Java and they are both great in their own way. PHP is definitely easier to use (in general), but Java is more powerful. It is a programming language vs. PHP being a scripting language. With that, there have been a lot of devlopments in the Java zone which have brought about many parsers and applications in general that can do many things with XML. Since Java is a programming language, it also enables you to expand on what you can do with XML and extend it to outside of the browser. Also, there are many classes that are available for parsing and transforming your XML into HTML (and other formats).

    So that is my long-winded yes (again, in my opinion).

    If you want to learn more about Java & XML used together, check out O'Reilly's Java & XML book. Here is the URL: http://www.oreilly.com/catalog/javaxml2/

    The web site gives you a sampling of the book here: http://www.oreilly.com/catalog/javax...pter/ch09.html

    It gives you a good introduction to using XML with Java, but it does assume that you know some Java. If you don't already, they have another book which helped me get up and running. It's called Learning Java. The URL for that one is: http://www.oreilly.com/catalog/learnjava/
    Edgar Castanedo

IMN logo majestic logo threadwatch logo seochat tools logo