abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James M Snell <jasn...@gmail.com>
Subject Re: declareDefaultNamespace
Date Sun, 23 Sep 2007 17:39:47 GMT
A patch would be helpful. Just post it to jira.  Out of curiosity,
however, are you able to set the default namespace in the xml string
before setting the value?

- James

Jason Calabrese wrote:
> While starting to work with Abdera I discovered that I needed to set the 
> default namespace for the xml element that I added to content.
> 
> I was able to do this by using the following code:
> String xml = ...
> Content content = entry.setContent(xml, Content.Type.XML);
> ((OMElement)content.getFirstChild()).declareDefaultNamespace(uri);
> 
> It would be nice to be able to do this without casting to an OMElement.  
> 
> Even better would be have a new method something like setContentAsXml(String 
> xml, String defaultNamespace). 
> 
> Does anyone else think this would be useful?  If so I'll work on a patch.
> 
> -Jason
> 

Mime
View raw message