This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: need an extra pair or two of eyes


Hi Randall,

A different approach might be to use a global variables XSL where you 
assign these values and include it with your primary XSL. A good thing 
about this approach is you can make decisions at transformation time, 
for example:

<!-- global_defintions.xsl -->
<!-- pass in param to transform -->
<xsl:param name="lang"/>

<xsl:variable name="img_uri">
   <xsl:choose>
      <xsl:when test="$lang='es'">
         <xsl:text>/images/spanish/</xsl:text>
      </xsl:when>
      <xsl:otherwise>
         <xsl:text>/images/</xsl:text>
      </xsl:otherwise>
   </xsl:choose>
</xsl:variable>

best,
-Rob




Randall Gremillion wrote:

>I have created a stylesheet that includes list of entities. Runining
>this through Resin, however, it chokes on resolving them.
>
>Opening of stylesheet (it is a secondary or imported stylesheet):
>
><?xml version="1.0"?>
><!DOCTYPE page [
>  <!ENTITY % styledefs SYSTEM "futuredex_ent.ent">
>  %styledefs;
>]>
><xsl:stylesheet xmlns:bebop="http://www.arsdigita.com/bebop/1.0";
>xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"
>xmlns:cms="http://www.arsdigita.com/cms/1.0";
>xmlns:fdx="http://www.futuredex.com/1.0";
>xmlns:frontend="http://www.futuredex.com/1.0/frontend";>
>	<xsl:output method="html" indent="yes"
>doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
>	<xsl:strip-space elements="*"/>
>	<!--VARIABLES-->
>	<xsl:variable name="title">
>		<xsl:value-of select="//bebop:title"/>
>	</xsl:variable>
>	<!--MAIN TEMPLATE-->
>	<xsl:template match="bebop:page"
>xmlns:bebop="http://www.arsdigita.com/bebop/1.0";>
>		<html>
>			<xsl:call-template name="head"/>
>			<body text="#000000" link="#336600"
>vlink="#669933" alink="336600" leftmargin="0" topmargin="0"
>marginwidth="0" marginheight="0"
>onLoad="MM_preloadImages('&img_uri;/nav_top-matchdex-on.gif','&img_uri;/
>nav_top-my_futuredex-on.gif','&img_uri;/nav_top-mam-on.gif','&img_uri;/n
>av_top-events-on.gif','&img_uri;/nav_top-analytics-on.gif','&img_uri;/na
>v_top-research-on.gif','&img_uri;/nav_top-search-on.gif','&img_uri;/nav_
>top-home-on.gif','&img_uri;/nav_side-private-on.gif','&img_uri;/nav_side
>-investors-on.gif','&img_uri;/nav_side-service-on.gif','&img_uri;/nav_si
>de-advisors-on.gif','&img_uri;/nav_side-press-on.gif','&img_uri;/nav_sid
>e-what-on.gif','&img_uri;/nav_top-directory-on.gif')"
>background="&img_uri;/side-bg.gif">
>
>xml file:
>
>  <?xml version="1.0" encoding="UTF-8" ?> - <bebop:page xmlns:bebop="http://www.arsdigita.com/bebop/1.0";>
>  <bebop:title>Futuredex</bebop:title> - <frontend:container xmlns:frontend="http://www.futuredex.com/1.0";
>requestURI="/xml/" class="/">
>- <frontend:container requestURI="/xml/" class="/index">
>  <frontend:temporaryHomePage />   <fdx:user-status xmlns:fdx="http://www.futuredex.com/1.0";
>is-logged-in="true" fullname="Gee Eye" id="35181" />   </frontend:container>
>  </frontend:container>
>  </bebop:page>
>
>Beginning of error message:
>
>javax.xml.transform.TransformerConfigurationException
>
>com.caucho.xml.XmlParseException:
>file:/c:/cygwin/home/grenma/resin-2.0.5/webapps/acs/packages/frontend/xs
>l/FDPage.xsl:17: expected local reference at `&img_uri;'
>	at com.caucho.xml.XmlParser.error(XmlParser.java:2549)
>	at com.caucho.xml.XmlParser.parseValue(XmlParser.java:1131)
>	at com.caucho.xml.XmlParser.parseAttributes(XmlParser.java:666)
>
>Any help is greatly appreciated.
>
>Sincerely,
>Randall Gremillion
>
>
>
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>  
>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]