Can not parse comments inside script tags with XPATH?

I expect the code below to produce something like
“comment between script tags”
“comment outside script tags”

Instead it produces:
NULL
“comment outside script tags”

Assuming my XPATH query is correct, why can’t I parse the comment node inside the script tags?
Is there something I am missing?


<?php
$html = '
<script>
<!-- comment between script tags //-->
</script>
<!-- comment outside script tags //-->
';

$dom = new DOMDocument();

@$dom->loadHTML($html);

$xpath = new DOMXPath($dom); //put $dom into xpath

$xpath_query[] = '//script/comment()';
$xpath_query[] = '//comment()';

foreach($xpath_query as $xpath_query)
	{
		$match = $xpath->query($xpath_query)->item(0)->textContent; //query dom for match

		echo '<pre>'; var_dump($match); echo '</pre><br />';
	}

?>


echo $dom->saveXML();

Should give you a clue as to why it isnt working…