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

[1006 byte] By [radium_cna] at [2007-9-30 23:35:17]
# 1
I think the default transform is the only standard way of converting a Document to a String. Xerces has a class that does the job: org.apache.xml.serialize.DOMSerializer
DigitalDreamera at 2007-7-7 14:49:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Thanks. Buddy.
radium_cna at 2007-7-7 14:49:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...