Skip to content
Advertisement

Tag: xml

Convert xml to java

How can I convert xml to java so that it could read the xml document and put it in to a database? Answer Check this: http://www.java-tips.org/java-se-tips/javax.xml.parsers/how-to-read-xml-file-in-java.html That’s how you read xml file. Then you just crate SQL query to insert it into database (JDBC?)

java.util.Date to XMLGregorianCalendar

Isn’t there a convenient way of getting from a java.util.Date to a XMLGregorianCalendar? Answer I should like to take a step back and a modern look at this 10 years old question. The classes mentioned, Date and XMLGregorianCalendar, are old now. I challenge the use of them and offer alternatives. Date was always poorly designed and is more than 20

How to pretty print XML from Java?

I have a Java String that contains XML, with no line feeds or indentations. I would like to turn it into a String with nicely formatted XML. How do I do this? Note: My input is a String. My output is a String. (Basic) mock result: Answer Now it’s 2012 and Java can do more than it used to with

Advertisement