we have a requirement of dynamically creating a XML document from the USer entered content from the UI .
Now please tell me what is the best way of creating the XML document dynamically either i used go for using SAX , DOM or manually like
StringBuffer.append("<users>");
Please share your thoughts .
Don’t build XML in strings, you’ll run into problems with user entered content creating invalid XML.
If your document is small (< 10 Mb), just create DOM Document, and use the create elements / attributes / CDATA sections. This approach will ensure that the results are valid XML.