Skip to content

Instantly share code, notes, and snippets.

@DuffleOne
Created March 28, 2014 23:42
Show Gist options
  • Save DuffleOne/9845318 to your computer and use it in GitHub Desktop.
Save DuffleOne/9845318 to your computer and use it in GitHub Desktop.
header('Content-type: text/xml');
$term = $_GET['value'];
$col = $_GET['column'];
$xmlDom1 = new DOMDocument();
$xmlString = '';
foreach ( file("http://stuweb.cms.gre.ac.uk/~mg109/COMP1688/index.php?col=$col&term=$term" ) as $node ) {
$xmlString .= trim($node);
}
$xmlDom1->loadXML($xmlString);
/*
$xmlDom2 = new DOMDocument();
$client = new SoapClient('http://stuiis.cms.gre.ac.uk/mk05/dotnet/dataBind01/phoneBook.asmx?WSDL');
$xmlString = $client->getDirectoryDom()->getDirectoryDomResult->any;
$xmlDom2->loadXML($xmlString);
*/
$xmlRoot = $xmlDom1->documentElement;
/*
foreach ( $xmlDom2->documentElement->childNodes as $node2 ) {
$node = $xmlDom1->importNode($node2,true);
$xmlRoot->appendChild($node);
}
}*/
if(isset($_GET['xhtml'])) {
$xslt = $xmlDom1->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="something.xsl"');
$xmlDom1->appendChild($xslt);
}
echo $xmlDom1->saveXML();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment