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 <[EMAIL PROTECTED]>
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
> [EMAIL PROTECTED]




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

Reply via email to