Return-Path: Delivered-To: apmail-xml-forrest-dev-archive@www.apache.org Received: (qmail 9009 invoked from network); 22 Oct 2003 18:52:22 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 22 Oct 2003 18:52:22 -0000 Received: (qmail 13987 invoked by uid 500); 22 Oct 2003 18:52:07 -0000 Delivered-To: apmail-xml-forrest-dev-archive@xml.apache.org Received: (qmail 13953 invoked by uid 500); 22 Oct 2003 18:52:07 -0000 Mailing-List: contact forrest-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: forrest-dev@xml.apache.org Delivered-To: mailing list forrest-cvs@xml.apache.org Delivered-To: moderator for forrest-cvs@xml.apache.org Received: (qmail 846 invoked from network); 22 Oct 2003 16:55:00 -0000 Date: 22 Oct 2003 16:55:07 -0000 Message-ID: <20031022165507.36092.qmail@minotaur.apache.org> From: unico@apache.org To: xml-forrest-cvs@apache.org Subject: cvs commit: xml-forrest/src/java/org/apache/cocoon/components/modules/input/lm LocationNode.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N unico 2003/10/22 09:55:07 Modified: src/java/org/apache/cocoon/components/modules/input/lm LocationNode.java Log: fix relative path resolving Revision Changes Path 1.2 +9 -6 xml-forrest/src/java/org/apache/cocoon/components/modules/input/lm/LocationNode.java Index: LocationNode.java =================================================================== RCS file: /home/cvs/xml-forrest/src/java/org/apache/cocoon/components/modules/input/lm/LocationNode.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- LocationNode.java 21 Oct 2003 08:33:36 -0000 1.1 +++ LocationNode.java 22 Oct 2003 16:55:07 -0000 1.2 @@ -93,14 +93,17 @@ String src = m_src.resolve(context,om); - // absolute, don't prefix - if (src.charAt(0) == '/' || SourceUtil.indexOfSchemeColon(src) != -1) { - return src; + // relative, prefix with locator base + if (src.charAt(0) != '/' && SourceUtil.indexOfSchemeColon(src) == -1) { + String base = (String) context.getMapByAnchor(LocationMap.ANCHOR_NAME).get("base"); + src = base + (base.charAt(base.length()-1) == '/' ? "" : "/") + src; } - else { - String base = (String) context.getMapByAnchor("lm").get("base"); - return base + (base.charAt(base.length()-1) == '/' ? "" : "/") + src; + + if (getLogger().isDebugEnabled()) { + getLogger().debug("location: " + src); } + + return src; }