Opened 10 years ago

Closed 10 years ago

# XsltMacro parameter passing with tracd

Reported by: Owned by: jmcarter9t@… roadrunner low XsltMacro minor 0.10

### Description

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?

Thanks

### comment:1 Changed 10 years ago by roadrunner

• Status changed from new to assigned

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 10 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> <xsl:template match="computer"> <!-- stuff that works on production server. --> </xsl:template> 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.

Jason

### comment:3 Changed 10 years ago by roadrunner

• Resolution set to fixed
• Status changed from assigned to closed

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.