Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 99312 invoked from network); 16 Nov 2002 20:57:29 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 16 Nov 2002 20:57:29 -0000 Received: (qmail 15577 invoked by uid 97); 16 Nov 2002 20:58:24 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 15534 invoked by uid 97); 16 Nov 2002 20:58:23 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 15522 invoked by uid 98); 16 Nov 2002 20:58:22 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: Sat, 16 Nov 2002 20:57:29 +0000 From: Frank Carver X-Mailer: The Bat! (v1.61) Personal Reply-To: Frank Carver Organization: Efficacy Solutions Limited X-Priority: 3 (Normal) Message-ID: <742078880250.20021116205729@efsol.com> To: ant-user@jakarta.apache.org Subject: Generating relative paths with XSLT MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N This is sort of an Ant question, and sort of an XSLT question. I've asked it here first, to see what I get. All suggestions or ideas where else to look welcome! I make a lot of use of Ant's XSLT task to build all the web pages in a site from simple XML definitions to fully marked up pages with fancy graphics and menus etc. This is a great technique because it allows a site-wide style change to be a simple (!) matter of modifying one XSLT stylesheet and reprocessing the page definitions. I prefer to do this before the pages are deployed, so I don't incur the hit of restyling and the chance of errors on the deployment server. Now, mostly, this works, but I have one problem. If I were making the pages by hand, I would use relative (eg. ../../images/logo.gif) URLs whenever I refer to another page or image in the stylesheet (for a common navigation menu or site-wide logo, for example). With the XSLT approach, I can't seem to work out how to do this. I have found two partial solutions: 1. Put all my pages at one "level", so that I can hard-code the relative references in the stylesheet. This rapidly leads to a very cluttered site with overcomplicated page names. 2. Use absolute (eg. http://www.mysite.org/application/images/logo.gif) or rooted (eg. /application/images/logo.gif) URLs. This is a little better, but fails if the application name is changed after deployment, or the application is deployed more than once with different names, or if I try and view the pages direct from disk rather than deploying them to a server. Does anyone have any suggestions for how I can use an arbitrary page hierarchy and still have the XSLT page styling generate the correct relative references? Many thanks. -- Frank Carver frank@efsol.com http://www.efsol.com/ -- To unsubscribe, e-mail: For additional commands, e-mail: