commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Gilde <hgilde-comm...@earthlink.net>
Subject RE: [Jelly] [post again] Can a Tag get his own namespace ?
Date Tue, 12 Oct 2004 13:36:32 GMT
Marc,

You can use some combination of LocationAware and NamespaceAwareTag (yes,
inconsistent interface names). I haven't tried this personally, so please
let us know if it doesn't work. :)

LocationAware should give you the namespace-qualified tag name (which you
must parse to get the namespace). NamespaceAware gives you the
namespace-to-uri map for the current XML element.

Hans

-----Original Message-----
From: Marc DEXET [mailto:Marc.Dexet@dsi.cnrs.fr] 
Sent: Tuesday, October 12, 2004 2:47 AM
To: Jakarta Commons Users List
Subject: [Jelly] [post again] Can a Tag get his own namespace ?

Hi.
I post again a question, if somebody who have missed the question and have a
answer.
Sorry if there's no answer :)

Imagine I get a set of implementation library like 
<jelly xmlns:lib1="jelly:mylib:impl1" xmlns:lib2="jelly:mylib:impl2">
	<lib1:createSomething/>
	<lib2:createSomething/>
</jelly>

Each library implements the same interfaces.
in "createSomething" I would call a static factory method depending on each
implementation.

public void doTag(XMLOutput output) throws
	MissingAttributeException, JellyTagException {
	String createSomethingUri = {something};
	TagLibrary lib = (TagLibrary)
	context.get(createSomethingUri);
	myObject = lib.getNewInstance();
}

But I dont find the {something} method to get the right uri.
How can I do ?
Thanks.
-- 
Marc DeXeT




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message