Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
11-15-2007, 02:31 AM #1
- Join Date
- Mar 2005
- D0u$h!t3 k4?
- Thanked 5 Times in 5 Posts
DOMDocument::xmlStandalone defined to be TRUE by default?
However, the spec says that it shouldn't be considered standalone because I never specified that it was or was not standalone.
Firefox's DOM says that it defaults to 'standalone="no"' (false), but PHP's DOMDocument::xmlStandalone outputs TRUE (standalone="yes"). Is this a bug in the XML parser?
A sample XML document with sample PHP code -
<?xml version="1.0" encoding="utf-8" ?> <foo> <bar /> </foo>Code:
<?php $doc = new DOMDocument(); if (!$doc->load('./example.xml')) die("Couldn't load document."); echo 'standalone="', ($doc->xmlStandalone === FALSE) ? 'no' : 'yes', '"'; ?>
Last edited by rpgfan3233; 11-15-2007 at 02:47 AM. Reason: Added sample codePHP Code:
$hello = file_get_contents('hello.txt'); echo $hello;