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: Extension Development
Date Thu, 07 Sep 2006 04:15:40 GMT
I made a change in the trunk today that would allow you to do stuff like...

QName FOO = ...
QName BAR = ...
QName BAZ = ...
ExtensibleElement foo = (ExtensibleElement)factory.newElement(FOO);
foo.addExtension(BAR);
foo.addExtension(BAZ);

Grab the trunk to test it out.

- James

Rob Evans wrote:
> Thanks, James.
> 
> I'll give this a shot; however, it's not immediately clear to me how Iame
> would nest elements to get something like:
> 
>  <sc:foo>
>     <sc:bar/>
>     <sc:baz/>
>  </sc:foo>
> 
> Chances are good that I just need to write some test code to learn how
> this works. ;-)
> 
> On 9/6/06, James M Snell <jasnell@gmail.com> wrote:
>> One way of implementing extensions that do not rely on the underlying
>> parser implementation would be to implement wrappers around the Feed
>> Object Model interfaces.  For instance,
>>
>>   Document<Feed> doc = ...
>>   Feed feed = doc.getRoot();
>>   QName myExtensionQName = new QName("urn:foo:bar", "Test");
>>   Element test_el = feed.getExtension(myExtensionQName);
>>   Test test = new TestImpl(test_el);
>>   test.getFoo();
>>   test.getBar();
> [snip]
> 

Mime
View raw message