[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Determining Web server address in xslt doc
On Jan 26, 2009, at 3:35 PM, Lee Surma wrote:
FYI I am a newbie who has been tasked with maintaining Anyway, you can't get it with XSL alone. You probably want to vary on parameters or some non-source-controlled XML lookup that you pull in with the document function. Another way would be to wrap the source xml instance with the host information. For example: <dev.imanewbiefool.com> ... the wrapped xml... </dev.imanewbiefool.com> and <www.imanewbiefool.com> ... the wrapped xml... </www.imanewbiefool.com> Then, instead of using a possibly huge choose, you can just match the root element: <xsl:import href="hosts.xsl"/> <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> and in hosts.xsl you could either import your individual hosts statically or generate your hosts based of a directory containing however many unique host xsls. Or just match them there: <xsl:template match="dev.imanewbiefool.com"> ... do whatev... </xsl:template> <xsl:template match="www.imanewbiefool.com"> ... do whatev... </xsl:template> -Rob
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|