Re: Making SimpleXML more useful
| From: | David Zülke | Date: | Sat, 30 Apr 2011 21:48:59 +0000 |
| Subject: | Re: Making SimpleXML more useful | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52125@lists.php.net to get a copy of this message | ||
On 30.04.2011, at 22:05, Ben Schmidt wrote:
> This adds a certain ambiguity to document creation if it is used, but it
> does add functionality not currently there. I guess it's only worth
> doing if there are specs out there in the wild that (wrongly IMHO)
> require "unqualified" names in XMLNames-conforming documents.
>
> So, if the OP or his associates are in control of his schema, I suggest
> he should change it; if he can point to a respectable public schema that
> does this, it would be worthy of greater consideration.
There is no such schema, because from a processing model perspective,
<foo xmlns="http://lol.com/burp" />
and
<bar:foo xmlns:bar="http://lol.com/burp" />
are identical; they both yield an element {http://lol.com/burp}foo.
You cannot through a schema require an element in an instance document to be in a namespace, but not
have a prefix (that is *not* what elementFormDefault in an XML is for), and it's not necessary,
because the prefix doesn't matter. The reason why namespace prefixes exist is that they make
things more readable for humans, and they decrease the file size.
David
Attachment: [application/pkcs7-signature] smime.p7s
Attachment: [application/pkcs7-signature] smime.p7s