unity3d in edit mode can read xml, published as a web mode can not read and why?

unity3d in edit mode can read xml, published as a web mode can not read and why?

Because webplayers have no local file I/O due to security restrictions (or at least that's what I assume you're doing given that you didn't provide any details).

This is a security issue, like Flash the unity webplayer needs to have policy files. The editor is not bound to the security restrictions of the webplayer.

You most probably need to have a crossdomain.xml in the root of the webdomain you are trying to read the xml from.

Put this in the crossdomain.xml for access from anywhere:

<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>

See this page in the documentation for more information.