convert XML document to string - problem with java applet
Hello,
I have to convert an XML document (org.w3c.dom.Document) to a string (java.lang.String) in a java applet. I was trying to use thejavax.xml.transform.Transformer.transform(Source, Result) method, but it just stuck there forever without returning. However, the transform method does work in a standalone java application as well as in a java servlet with no problem. It seems that this method only fails when called from within a java applet. In a guess that the problem may be related to some security issues of java applet, I changed the<jre_home>\lib\security\java.policy file to grant permissions asjava.security.AllPermission, and that happened to solve the problem. But I still don't know why this happens and how may I solve it from the coding perspective. Or is there any walk-around to the problem in which I can avoid using theTransformer.transform method?
Thank you very so much for any clarifications and suggestions.
Yuanlei

