[Home] [By Thread] [By Date] [Recent Entries]
On Aug 19, 2008, at 2:41 PM, G. Ken Holman wrote:
At 2008-08-19 14:19 -0600, Quinn Taylor wrote:I've created a recursive template (printRecursivePath) to process a Sorry, I thought that using the commented code might give an idea, and I was aiming for brevity. I'm not just trying to create a relative path from an absolute path. Allow me to clarify... I'm using this for browsing Subversion repositories hosted from Apache, using the mod_dav_svn module, which provides XML output that can be styled. (For example, http://svn.macosforge.org/repository/macports/trunk/www/ uses the default XSL file, which I find pretty hideous.) I'm trying to make it easier to link directly to any directory along the path, and any path should include spaces on either side of the slashes, and a "[root]" link at the beginning. For an example of what I'm talking about, compare the default HTML (http://svn.collab.net/repos/svn/trunk/doc/ ) with the output produced by ViewVC (http://svn.collab.net/viewvc/svn/trunk/doc/ ), specifically the gray bar on the top of the latter. What result to you expect for your test string "/path/to/resource"? <a href="../../../">[root]</a> / <a href="../../">path</a> / <a href="../">to</a> / resource What result to you expect for "/to/resource"? <a href="../../">[root]</a> / <a href="../">to</a> / resource What result to you expect for "/resource"? <a href="../">[root]</a> / resource What result to you expect for "resource"? I don't handle this one, since all my paths provided by subversion will have a leading / to indicate the full repository path. The problem occurs for path components between the first and the last component. Actually, all the text which is generated by a recursive call to the template is saved in a variable using this chunk of code: <!-- Make a tail-recursive call and store the text result in a variable --> <xsl:variable name="recursiveResult"> <xsl:call-template name="printRecursivePath"> <xsl:with-param name="text" select="$tail"/> </xsl:call-template> </xsl:variable> If you run my code with the commented code un-commented, you can actually see that $parentPath has the value I want, it just isn't printing out what I need. <snip> Since I didn't fully explain what I hoped to see, the code you sent doesn't directly solve my problem, but does have some nice things I can glean to hopefully make mine cleaner and more robust. Thanks, - Quinn <snip>
|

Cart



