June 13th, 2001, 06:56 AM
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.
June 14th, 2001, 06:50 AM
June 18th, 2001, 12:51 PM
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/