Skip to content
Prev 309270 / 398506 Next

XML namespace control

Hi Duncan,
On Oct 29, 2012, at 9:24 AM, Duncan Temple Lang wrote:

            
Ah!   The parent - of course!  This makes perfect sense (and says so in the docs).   I think I was focussing on building up the hierarchy from the inside-to-the-outside.  That's obviously backwards (of course it's obvious now that I have gone public!)  

I must have I missed the boat when I read the documentation for the namespace argument to newXMLNode() ... 

"If this is a character vector with a) one element and b) with an empty names attribute and c) whose value does not start with http:/ or ftp:/, then it is assumed that the value is a namespace prefix for a namespace defined in an ancestor node. To be able to resolve this prefix to a namespace definition, parent must be specified so that we can traverse the chain of ancestor nodes. "

I wonder if that last sentence might be amended to read,  "To be able to resolve this prefix to a namespace definition, parent must be specified so that we can traverse the chain of ancestor nodes _to where the namespace is defined._"  I realize that this addition repeats the meaning of the previous sentence, but repetition never hurts boneheads like me. 

The bigger picture is that I am using this with a RESTful system which has been very kindly to this neophyte.  The parent tree, of which these user defined fields are children, will be POSTed to the system (using RCurl).    

I have the parent just as you have shown 'top' above, but I had not included the namespace definitions that any of its children might need.  I have added the namespace definitions needed to the parent definition and all is well.

Thanks, once again, for making the XML package available.  It is incredibly useful.

Cheers,
Ben
Ben Tupper
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd. P.O. Box 475
West Boothbay Harbor, Maine   04575-0475 
http://www.bigelow.org