On Wednesday 19 March 2003 02:03 pm, Schuetz, David wrote:
> Okay, I know we can do things like:
>
>   <xi:include href="myfile.xsp"/>
>
> or
>
>   <util:include-uri href="myfile.xsp"/>
>
> and it'll Just Work.  (at least, I've been using xi:include with little
> problem).
>
>
> But what if you want to dynamically set the href?  That is, let's say I
> call a page like this:
>
>   node_summary.xsp?id=5
>
> and I want it to include
>
>   node_detail.xsp?id=5
>
> (though in this case, it'd really be
>       node_detail.xsp?id=<param:id/>
> )
>
>
> How do I do that?  That is, how can I put in an .xml or .xsp file, an
> include where the href attribute is determined dynamically?
>
> I've seen mention of things that made me try:
>
>   <xi:include><xsp:attribute name="href">node_detail.xsp?id=5<....>
>
> or
>
>   <xi:include><href>node_detail.xsp?id=5</href></xi:include>

You're correct, these strategies don't work... In fact I concluded that there 
is no existing XSP functionality that can do what you want. You thus have to 
figure out another alternative.

1) Write a taglib that does what you want (why the existing util taglib isn't 
set up this way is a mystery, it should be trivial, perhaps just patch it?)

2) You can do it AFTER XSP processing either in XSLT (in which case its fairly 
trivial) or by creating some other type of stylesheet or element (SAX works, 
as does XPathScript).

3) Well, all the other ways I can think of require even more work, though they 
might be superior in the long run, like a provider, etc.

Honestly I think writing a Taglib is the best idea. Its really not that hard, 
just use the TaglibHelper module. All you're really doing is writing a perl 
subroutine in a package with a tiny bit of extra info so XSP can compile a 
call to it.

>
> but these don't work (nor do they work with util:include-uri).  Is there a
> standard way to dynamically modify attributes within .xsp or .xml files? 
> Or am I out of luck?  (no, I don't want to write a taglib of my own just
> yet...)
>
>
> Thanks!!
>
> david.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Tod Harter
Giant Electronic Brain

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to