[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] XALAN - obtaining the -XSL stylesheet name?
Subject: RE: [xsl] XALAN - obtaining the -XSL stylesheet name? From: "Tim Watts" <timw@xxxxxxx> Date: Thu, 29 Mar 2001 14:43:17 +1000 |
We use something like so... <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:include href="../document.xsl" /> <xsl:include href="../common.xsl" /> <xsl:param name="title">Edit Settings Wizard</xsl:param> <xsl:template name="body"> ... </xsl:template> </xsl:stylesheet> with the document.xsl containing <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="document"> <html lang="{language/html-language}" dir="{language/html-text-direction}"> <head> <link rel="stylesheet" type="text/css" href="{isp/settings/css-base}/{isp/settings/css-url}.css"/> <title><xsl:value-of select="$title"/></title> </head> <body> ... <xsl:call-template name="body"/> ... </body> </html> </xsl:template> </xsl:stylesheet> This passes the param "title" to the html for use in the external stylesheet, simular to how you want to pass a param to your external stylesheet. This can be directly duplicated into your style sheet in the same way. The param is just declared in the first stylesheet and can be used in the external one. best wishes, Tim Watts -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Robert Nicholson Sent: Thursday, 29 March 2001 2:20 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] XALAN - obtaining the -XSL stylesheet name? 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:apply-templates select="us-address"/> </xsl:template> <xsl:template match="us-address"> <address> ... </address> </xsl:template> <xsl:template match="start-date"> ... </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. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] XALAN - obtaining the -XS, Robert Nicholson | Thread | RE: [xsl] XALAN - obtaining the -XS, Robert Nicholson |
Re: [xsl] CJK UTF-16 test, Mike Brown | Date | RE: [xsl] XALAN - obtaining the -XS, Robert Nicholson |
Month |