0

I am new to Xsl .i want to load a xsl file from a http location .i am using this following code and the result is false (Can't load).

$xsl = new DomDocument;
  $path=('http://www.clearcube.com/support/view/home.xsl');
  $load_result=$xsl->load($path);

    if(!$load_result){
         echo "Can't load " ;

    }else{
        echo'loaded';

         }

i have no idea why this file is not loading .Please help and suggestion Thanks in advance

Ahsan aslam
  • 1,149
  • 2
  • 16
  • 35
  • 2
    You should enable the display of warnings and notices. Add the following to the top of your script: `ini_set('display_errors', 1); error_reporting(~0);`, compare as well with the PHP Manual error configuration and please see [How to get useful error messages in PHP?](http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php). – hakre Oct 16 '12 at 08:43
  • @hakre enable the display_error in php.ini i am getting this Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: Name or service not known – Ahsan aslam Oct 16 '12 at 08:56
  • Please add the error message into your question, so it's more clear what the concrete problem is (in comments it's hidden). Also you need to contact your system administrator and tell him the error message (and the URL). It looks like there is a problem with resolving the hostname on your server. – hakre Oct 16 '12 at 09:47

1 Answers1

1

After enable the display_errors in php.inin file .i get this following warning

Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: Name or service not known

then i came to know that this is due to not external access of this file in server. so change the file external url (http://www.clearcube.com/support/view/home.xsl) to eternal url (abc/test/view/home.xsl). thats solution work for me.

Ahsan aslam
  • 1,149
  • 2
  • 16
  • 35