Subject: Re: [xsl] getting XSL to output XSL... From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> Date: Thu, 16 Aug 2001 09:27:12 +0100 |
Hi Rafael, > How do I write a stylesheet that generates another stylesheet? Will > XSLT processors be smart enough to note that: > > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:xslout="http://www.w3.org/1999/XSL/Transform" > version="1.0"/> > > the <xslout:.../> tags are not supposed to be processed? I've > thought of slightly modifying the namespace URI for the new > stylesheet but I want to avoid making manual changes to the result > if at all possible. As far as XSLT processors (and any namespace-aware application) is concerned, the two prefixes 'xsl' and 'xslout' mean exactly the same thing and can be used interchangeably. But you're part way there. Change the xslout namespace a little so that it's not the XSLT namespace, e.g. to: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslout="http://www.w3.org/1999/XSL/TransformAlias" version="1.0"> ... </xsl:stylesheet> Then use the xsl:namespace-alias element to tell the processor that elements and attributes that you generate in the xslout namespace should be output in the XSLT namespace, with: <xsl:namespace-alias stylesheet-prefix="xslout" result-prefix="xsl" /> You can then use xslout as the prefix on the elements that you want to output, and xsl as the prefix on the elements that you want to act as instructions. I hope that helps, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] getting XSL to output XSL, Aleksei Valikov | Thread | Re: [xsl] getting XSL to output XSL, Gary Frederick |
Re: [xsl]xpath for getting file ver, Jeni Tennison | Date | Re: [xsl] xsl:fallback, nodesets, a, Jeni Tennison |
Month |