abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Calabrese <m...@jasoncalabrese.com>
Subject declareDefaultNamespace
Date Sat, 22 Sep 2007 19:36:37 GMT
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