Author: andreas
Date: Tue Sep 6 05:53:55 2005
New Revision: 278990
URL: http://svn.apache.org/viewcvs?rev=278990&view=rev
Log:
Add correct URL prefix for relative schema locations.
Modified:
lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap
lenya/trunk/src/webapp/lenya/xslt/bxe/translate-rng-includes.xsl
Modified: lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap?rev=278990&r1=278989&r2=278990&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap (original)
+++ lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap Tue Sep 6 05:53:55
2005
@@ -96,6 +96,7 @@
<map:generate src="fallback://{2}.rng"/>
<map:transform src="../../xslt/bxe/translate-rng-includes.xsl">
<map:parameter name="root"
value="{request:contextPath}/{page-envelope:publication-id}/{page-envelope:area}/schemas/"/>
+ <map:parameter name="uri" value="{request:requestURI}"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
@@ -104,6 +105,7 @@
<map:generate src="fallback://lenya/modules/{2}/schemas/{2}.rng"/>
<map:transform src="../../xslt/bxe/translate-rng-includes.xsl">
<map:parameter name="root"
value="{request:contextPath}/{page-envelope:publication-id}/{page-envelope:area}/schemas/"/>
+ <map:parameter name="uri"
value="{request:contextPath}/{page-envelope:publication-id}/{page-envelope:area}/schemas/fallback/lenya/modules/{2}/schemas/{2}.rng"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
Modified: lenya/trunk/src/webapp/lenya/xslt/bxe/translate-rng-includes.xsl
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/xslt/bxe/translate-rng-includes.xsl?rev=278990&r1=278989&r2=278990&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/xslt/bxe/translate-rng-includes.xsl (original)
+++ lenya/trunk/src/webapp/lenya/xslt/bxe/translate-rng-includes.xsl Tue Sep 6
05:53:55 2005
@@ -4,6 +4,26 @@
<xsl:param name="root"/>
+ <xsl:param name="uri"/>
+
+
+ <xsl:template name="stripLastStep">
+ <xsl:param name="text"/>
+ <xsl:if test="contains($text, '/')">
+ <xsl:value-of select="substring-before($text, '/')"/>
+ <xsl:text>/</xsl:text>
+ <xsl:call-template name="stripLastStep">
+ <xsl:with-param name="text" select="substring-after($text, '/')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+
+ <xsl:variable name="baseUri">
+ <xsl:call-template name="stripLastStep">
+ <xsl:with-param name="text" select="$uri"/>
+ </xsl:call-template>
+ </xsl:variable>
<xsl:template match="rng:include/@href[starts-with(., 'fallback://')]">
@@ -15,6 +35,14 @@
</xsl:template>
+ <xsl:template match="rng:include/@href[not(starts-with(., 'fallback://'))]">
+ <xsl:attribute name="href">
+ <xsl:value-of select="$baseUri"/>
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+
+
<xsl:template match="@*|node()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|