abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Calavera" <david.calav...@gmail.com>
Subject Re: Adding extensions to the entry
Date Tue, 22 Jul 2008 07:07:56 GMT
Nop, it's not a bug, there is other way to do that. You should use nested
elements, look at the code:

ExtensibleElement root = entry.addExtension(new QName("http://www.test.com",
"rootElement"));
root.addSimpleExtension(new QName("http://www.test.com", "elementA"),
"valueA");
root.addSimpleExtension(new QName("http://www.test.com", "elementB"),
"valueB");



On Tue, Jul 22, 2008 at 3:45 AM, Zeenat Lainwala <lainwala@us.ibm.com>
wrote:

> I am trying to add an extension to an entry. The extension itself is an
> anonymous complex type with the following serialized form
> <xns:rootElement xmlns:xns="http://www.test.com">
>        <xns:elementA>valueA</xns:elementA>
>        <xns:elementB>valueB<xns:elementB>
> </xns:rootElement>
>
> I tried the following code but it didn't work.
> Element rootElement = atomFactory.newElement(new QName(
> "http://www.test.com", "rootElement"));
> Element elementA = atomFactory.newElement(new QName("http://www.test.com",
> "elementA"));
> Element elementB = atomFactory.newElement(new QName("http://www.test.com",
> "elementB"));
> elementA.setParentElement(rootElement);
> elementB.setParentElement(rootElement);
> entry.addExtension(rootElement);
>
> The parent of elementA and elementB is set to rootElement but elementA and
> elementB
> are not set as the children of rootElement. Is this a bug?
>
> Is there any other way to achieve this?
>
> Thanks,
> Zeenat
> IBM Websphere Process Server
> 650 645 8159, T/L:337 8159
> Cell: 650 483 4022
> lainwala@us.ibm.com




-- 
David Calavera
http://www.thinkincode.net

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message