On Jun 28, 2006, at 1:16 PM, Andrew Gibson wrote:

> BAM! :) thanks, I never noticed that. Is that an XML standard  
> thing? if
> you have a default namespace, you define it twice? once with no prefix
> and again with the prefix you'll need to access it?

It is definitely not required by XML to do this. Though I never  
thought much about it before I saw your example. Let's assume that  
XPath as implemented in both REXML and the Ruby libxml wrapper are  
not broken in the same way, then you do need the prefix defined when  
using XPath (unless there is some other way), and so I'd think an  
apparently redundant ns definition would be a fairly common thing to  
do since it isn't really redundant. But I'm not an XPath expert  
(don't really use it at all actually).

Cheers,
Bob

>
>
>
> Bob Hutchison wrote:
>> Hi,
>>
>> On Jun 27, 2006, at 9:06 PM, Andrew Gibson wrote:
>>
>>> ** notice the top two elements: <DocumentPorperties> and
>>> remove the namespace attribute, but nothing when I put it back in.
>>>
>>> ---- Actual Question ---
>>> Is this just a weird instance of XML which REXML doesn't support or
>>> do I
>>> need to be doing some fancy XPath footwork to make it work?
>>
>> XPath footwork. Write:
>>
>> @doc.root.elements.each('ss:Worksheet') {}
>>
>> The prefix 'ss' is defined and equal to the default namespace of the
>> Worksheet element.
>>
>> Cheers,
>> Bob
>>
>>>
>>> cheers and thanks! :)
>>>
>>> Andrew
>>>
>>
>> ----
>> Bob Hutchison                  -- blogs at <http://www.recursive.ca/
>> hutch/>
>> Recursive Design Inc.          -- <http://www.recursive.ca/>
>> Raconteur                      -- <http://www.raconteur.info/>
>> xampl for Ruby                 -- <http://rubyforge.org/projects/ 
>> xampl/>
>
>
> -- 
> Posted via http://www.ruby-forum.com/.
>

----
Bob Hutchison                  -- blogs at <http://www.recursive.ca/ 
hutch/>
Recursive Design Inc.          -- <http://www.recursive.ca/>
Raconteur                      -- <http://www.raconteur.info/>
xampl for Ruby                 -- <http://rubyforge.org/projects/xampl/>