开发者

how to download an xml namespace and use on local server?

开发者 https://www.devze.com 2023-04-01 01:39 出处:网络
I am trying to transform an xml document using simpleXML, but the server that holds the name space responds slowly so if possible I want to move the file that holds the namespace to my server.

I am trying to transform an xml document using simpleXML, but the server that holds the name space responds slowly so if possible I want to move the file that holds the namespace to my server.

Here is the code that calls it:

$XML = simplexml_load_string($result,NULL,NULL,"http://schemas.xmlsoap.org/soap/envelope/");
$XML->registerXPathNamespace('tree','www.tree.com');<----want to point it to my ser开发者_StackOverflowver instead
$var = $XML->xpath('//tree:data');


A namespace is not a file or a resource. You should not normally attempt to use a namespace URI to fetch anything from the web. If you do so, it's quite unpredictable whether you will get anything back, and if so, what it might be. It's not clear to me why you are fetching the namespace URI or what XML you expect to find there, but it is clear from your question that you haven't understood namespaces.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号