Subject: RE: [xsl] XALAN - obtaining the -XSL stylesheet name? From: "Robert Nicholson" <robert@xxxxxxxxxxxx> Date: Wed, 28 Mar 2001 20:20:22 -0800 |
Currently I have resume-us-html.xsl defined as such <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:import href="http://localhost:8080/jobserve/jsp/resume-common-html.xsl"/> <xsl:output method="html" indent="yes"/> <xsl:template match="contact-information"> <xsl:value-of select="name"/> <br/> <xsl:apply-templates select="us-address"/> </xsl:template> <xsl:template match="us-address"> <address> <xsl:value-of select="street"/> <br/> <xsl:value-of select="city"/> <br/> <xsl:value-of select="state"/> <xsl:text> </xsl:text> <xsl:value-of select="zip"/> <br/> <xsl:value-of select="email"/> <br/> </address> </xsl:template> <xsl:template match="start-date"> <xsl:value-of select="format-number(month, '##')"/>/<xsl:value-of select="format-number(day, '##')"/>/<xsl:value-of select="format-number(year,'##')"/> </xsl:template> <xsl:template match="end-date"> <xsl:choose> <xsl:when test="not(string-length(year))">Current</xsl:when> <xsl:otherwise> <xsl:value-of select="format-number(month, '##')"/>/<xsl:value-of select="format-number(day,'##')"/>/<xsl:value-of select="format-number(year,'##')"/> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> Notice the import Now the document element's (<resume>) template rule is defined in my common stylesheet thus <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="resume"> <html> <head> <title>Resume</title> </head> <body onLoad="pagePopUp("url derived from stylesheet name")> I want the url argument of pagePopUp of the resulting html to be derived from the stylesheet that I'm passing as -XSL to XALAN which is the same stylesheet that's importing the common stylesheet. > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Tim Watts > Sent: Wednesday, March 28, 2001 8:01 PM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: RE: [xsl] XALAN - obtaining the -XSL stylesheet name? > > > Robert, > > Do you mean calling a template contained in an external stylesheet with a > parameter of the current xslt's name? > > I can't see how this would be different from the normal passing of params, > such as > > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xsl:include href="external-stylesheet.xsl" /> > > <xsl:template name="internal-template-name"> > ... > <xsl:call-template name="external-template-name"> > <xsl:with-param name="xsl-name">current-xsl-name.xsl</xsl:with-param> > </xsl:call-template> > ... > </xsl:template> > </xsl:stylesheet> > > which calls... > <xsl:template name="external-template-name"> > <xsl:param name="xsl-name" /> > ... > </xsl:template> > from the external template > > Tim Watts > > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Robert > Nicholson > Sent: Thursday, 29 March 2001 1:13 PM > To: Xsl-List > Subject: [xsl] XALAN - obtaining the -XSL stylesheet name? > > > I have some common xsl templates factored into one stylesheet but > in here I > need to generate HTML that uses the specific XSL stylesheet name. In this > case it will be the stylesheet who is importing the common stylesheet. > > So with xalan is there any way in a stylesheet to know which is the -XSL > stylesheet parameter? is there a stylesheet parameter set for this? > > Basically my common stylesheet defines a body tag and I want to use an > onLoad event that references the current stylesheet name and > passes that to > a javascript event function. > > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] XALAN - obtaining the -XS, Tim Watts | Thread | RE: [xsl] XALAN - obtaining the -XS, Tim Watts |
RE: [xsl] XALAN - obtaining the -XS, Tim Watts | Date | Re: [xsl] CJK UTF-16 test, Mike Brown |
Month |