Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP bug #55317 test
<?php
$url = 'http://chalk.coas.unf.edu/eureka/files/templates/tmpl_chm.xml';
$xml = file_get_contents($url);
echo "---- Expected ----" . PHP_EOL;
echo $xml . PHP_EOL;
echo "Length: " . strlen($xml) . PHP_EOL;
$simpleXml = simplexml_load_file($url);
$sXml = $simpleXml->asXML();
echo "---- Actual ----" . PHP_EOL;
echo $sXml;
echo "Length: " . strlen($sXml) . PHP_EOL;
---- Expected ----
<?xml version="1.0" encoding="UTF-8"?>
<!-- Chemical Template - ExptML v0.1 SJC 7/29/11 -->
<!DOCTYPE chemical SYSTEM "http://chalk.coas.unf.edu/eureka/files/exptml/exptml_entities.dtd">
<chemical id="pid" xmlns="urn:exptml:schema:draft:0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:unitsml="urn:oasis:names:tc:unitsml:schema:xsd:UnitsMLSchema-1.0"
xsi:schemaLocation="urn:exptml:schema:draft:0.1 http://chalk.coas.unf.edu/eureka/files/exptml/exptml_chemical.xsd" version="0.1">
</chemical>
Length: 512
---- Actual ----
<?xml version="1.0" encoding="UTF-8"?>
<!-- Chemical Template - ExptML v0.1 SJC 7/29/11 -->
<!DOCTYPE chemical SYSTEM "http://chalk.coas.unf.edu/eureka/files/exptml/exptml_entities.dtd">
<chemical xmlns="urn:exptml:schema:draft:0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:unitsml="urn:oasis:names:tc:unitsml:schema:xsd:UnitsMLSchema-1.0" id="pid" xsi:schemaLocation="urn:exptml:schema:draft:0.1 http://chalk.coas.unf.edu/eureka/files/exptml/exptml_chemical.xsd" version="0.1">
</chemical>
Length: 510
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.