Re: [xsl] RE: Transformation XML to XML

Subject: Re: [xsl] RE: Transformation XML to XML
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 19 Jul 2005 16:04:28 +0100
You probably just need two templates:

<xsl:template match="collection">
<collection>
<xsl:apply-templates/>
</collection>
</xsl:template>

<xsl:template match="image">
<image>
<xsl:for-each select="*">
<xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
</image>
</xsl:template>




> The XML page cannot be displayed 
> Cannot view XML input using style sheet. Please correct the error and then
> click the Refresh button, or try again later. 

This indicates that you are testing your stylesheet by running it in
IE. Using a browser for stylesheet development can be painful as
browsers are not really designed to report errors, and you can't see the
generated html, only the rendering that is produced by that html.

It's best to first test with a command line tool (or integrated editing
xslt IDE) (saxon is good for this) so that you can generate actual html
files and get sensible error messages. then run on the browser once it's
working.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread