Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16242 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77383 invoked by uid 1010); 13 May 2005 21:35:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 57863 invoked from network); 13 May 2005 21:13:08 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 13 May 2005 21:13:08 -0000 X-Host-Fingerprint: 216.117.147.250 unknown Linux 2.4/2.6 Received: from ([216.117.147.250:43830] helo=ctindustries.net) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id F9/87-36148-36815824 for ; Fri, 13 May 2005 17:13:07 -0400 Received: from [127.0.0.1] (dsta-aa203.pivot.net [66.186.171.203]) (authenticated bits=0) by ctindustries.net (8.12.8/8.12.8) with ESMTP id j4DK5WTw027410; Fri, 13 May 2005 16:05:34 -0400 Message-ID: <428519AE.2010404@ctindustries.net> Date: Fri, 13 May 2005 17:18:38 -0400 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: George Schlossnagle CC: PHPdev List References: <4FFCA3A4-8367-432F-A665-391F804F6C8A@omniti.com> In-Reply-To: <4FFCA3A4-8367-432F-A665-391F804F6C8A@omniti.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.84/876/Thu May 12 19:14:29 2005 on ctindustries.net X-Virus-Status: Clean Subject: Re: [PHP-DEV] annoying DOM limitation From: rrichards@ctindustries.net (Rob Richards) I had just posted a comment on your blog about this. $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsd','http://www.w3.org/2001/XMLSchema'); should do exactly what you want. Rob George Schlossnagle wrote: > While hacking on a PHPDoc -> WSDL generator, I ran into an annoying > limitation in the dom extension: you can't add a namespace to a dom > document unless you have an element in that namespace. Why might you > want to do this? Well, a common thing is to have your xml-schema > types to be specified as attribute values, i.e. > > > > for this to work I need xsd to be an alias for http://www.w3.org/2001/ > XMLSchema. > > To work around this, I added a DomElement::addNS($uri, $alias) method > to Dom. Adding the namespace 'manually' as an attribute on an > element does not work. > > I know this isn't part of the Dom spec, but it's incredibly useful. > Does anyone (Rob, Chegru) mind me adding it to HEAD? >