Re: Making SimpleXML more useful
| From: | Rob Richards | Date: | Wed, 27 Apr 2011 10:08:18 +0000 |
| Subject: | Re: Making SimpleXML more useful | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52027@lists.php.net to get a copy of this message | ||
On 4/27/11 1:59 AM, Tom Samplonius wrote:
----- Original Message -----It is not being used as a namespace name. It's usage causes removes any default namespace from scope (continue reading spec - there is even an example of it). That line means you cannot define xmlns:a="" and then use use a as a prefix in the document.Looking at this in more detail...I don't think there's a bug here, or a patch required....... Absolutely, if the XML schema has the "elementFormDefault" attribute set to "unqualified", the child elements must be unqualified.problem for me, as I have an XML schema that specifies that the child elements must not namespace qualified.Is this possible in an XML schema? I don't know much about schemas, butI would also expect, if the child were to be namespaced, that these are equivalent: <ns1:parent xmlns="whatever" xmlns:ns1="whatever"> <child>abc</child> </ns1:parent> <ns1:parent xmlns:ns1="whatever"> <ns1:child>abc</ns1:child> </ns1:parent>... In the first case, the<child> element is unqualified, and in the second, it is not. They are not the same thing, either semantically or otherwise.and the xmlns="" is necessary. If this functionality were removed, how could this be done?For what? In the spec (http://www.w3.org/TR/xml-names/#iri-use), it says: "The empty string, though it is a legal URI reference, cannot be used as a namespace name."
The syntax is valid and required. Removing it breaks its usage. RobSure, SimpleXML could perhaps output XML that is slightly more efficient/less verbose than it currently does, but its output is not incorrect, and the functionality you want to remove is necessary in other circumstances.I don't see how removing the ability to use "" as a namespace is an issue, since "" can't be used as a namespace name.