Opened 12 years ago

Closed 12 years ago

#779 closed task (fixed)

XsltMacro parameter passing with tracd

Reported by: jmcarter9t@… Owned by: roadrunner
Priority: low Component: XsltMacro
Severity: minor Keywords:
Cc: Trac Release: 0.10


I am having problems getting this macro to work using parameters

Xslt(file.xslt, file.xml, xp_param='something')

on my local machine with tracd as the server. Is this a known issue? The same XML and XSLT files work fine on the production server. Do I just need to get my trac install to work with Apache?


Attachments (0)

Change History (3)

comment:1 Changed 12 years ago by roadrunner

Status: newassigned

What _exactly_ is the problem? Are getting nothing, or something other than what you expect? Are you saying it works without parameters but fails with them? Is there anything in the logs?

Note that I haven't tested with trac 0.10 yet, but I don't think that should be a problem. I also haven't tested with tracd :-( But it should work on both.

comment:2 Changed 12 years ago by jmcarter9t

Same file as production server where this works.

asg_machine_summary.xsl file:

<xsl:template match="/systems">

<xsl:apply-templates select="computer[@id=$machineid]"/>


<xsl:template match="computer">

<!-- stuff that works on production server. -->


This code yields the following error message:

Error: Macro Xslt(source:/trunk/asg_machine_summary.xsl, source:/trunk/asg_systems.xml, xp_machineid='1') failed

error return without exception set

When I try to just print out the value of $machineid with a value_of tag it also dumps. When I take all references to the parameter machineid out everything is fine.

I did get this working on the production server with your help. It was my code. Once I figured out the XSL template stuff. But I thought this would work on my local install since I got the very same thing to work on the production server.

Thanks for the look-see.


comment:3 Changed 12 years ago by roadrunner

Resolution: fixed
Status: assignedclosed

Fixed in [1360] (v 0.4). This was a problem with libxslt not liking unicode strings as produced by trac 0.10.

The exception was a bit misleading: that exception is thrown when the result is empty, which is the case with your stylesheet when no entry matches the machineid (or no machineid was give). I've fixed it to recognize that exception.

Thanks for reporting the problem.

Modify Ticket

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

Add Comment

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

Note: See TracTickets for help on using tickets.