Re: [xslt] indentation problem and some related questions



Viktor Štujber wrote:

I'm using the standard xml input as a way to pass parameters to the
xsl stylesheet. Therefore it's occupied. Also, the name of the actual
document to be loaded is dynamic and determined at run-time.
still, seems weird. there is simple way to pass parameters,
and to pass the name of the input file, dynamically

In the original document, these elements existed under a default
namespace. My stylesheet also declares this namespace and also uses it
as default. Since the namespaces match, I shouldn't need to do any
extra steps, right?

yes, you should. the default namespace in the stylesheet
relates to the _output_, not the input (XSLT 2.0 would help
you here).

Yeah, but the xsl:copy-of operation copies over all xmlns: attributes,
even for namespaces that are never used in the final output.

ah, the deep copy-of does that.

I suppose I'd add in an identity transform:

<xsl:template match="@*|text()|comment()|processing-instruction()">
 <xsl:copy-of select="."/>
</xsl:template>


<xsl:template match="*">
  <xsl:copy>
    <xsl:apply-templates
	select="*|@*|processing-instruction()|comment()|text()"/>
  </xsl:copy>
</xsl:template>

and let nature take its course. that should avoid the
extras.
--
Sebastian Rahtz
Information Manager, Oxford University Computing Services
13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]