Opened 15 years ago

Closed 14 years ago

#5275 closed enhancement (fixed)

Pass through URI parameters

Reported by: Kate Owned by: roadrunner
Priority: normal Component: XsltMacro
Severity: normal Keywords: xslt param docbook
Cc: Trac Release: 0.11


Firstly, thank you for such a nice little macro. Finally, I have a way to integrate docbook into Trac, without having to maintain separate Trac-themed HTML pages. I've two (related) feature requests:

I'm wondering about pagination for large documents. Would it be convenient for the macro to find ?page=123 style arguments from the URI, and pass these through to the stylesheet as <xsl:param> parameters? (These can be programatically bound before executing the stylesheet). I guess it's a bit weird for a macro to pick things up from the request URI, but it seems to make sense in this case.

Another approach would be to pass parameters as extra macro arguments: [[Xslt(..., ..., 'page=1')]] or somesuch. In my case for pagination I'd need to make a separate wiki page per-chapter, though, which wouldn't be nice - but I think passing params here could also be useful in general, for other situations.

Attachments (0)

Change History (2)

comment:1 Changed 14 years ago by roadrunner

See macro's documentation in the WikiMacros page after installing this macro: you can specify arbitrary xslt parameters by passing those parameters to the macro and prefixing them with 'xp_'. Example:

[[Xslt(view.xsl, doc.xml, xp_foo=yes, xp_bar=42)]]

would pass 'foo=yes' and 'bar=42' parameters to the transform.

As for passing through http request parameters, that's an interesting idea.

comment:2 Changed 14 years ago by roadrunner

Resolution: fixed
Status: newclosed

(In [7914]) Pass (http) request parameters which start with xp_ to the stylesheet as additional parameters. This can be useful for example to implement paging.

This closes #5275.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain roadrunner.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.