Subject: | problem using <xsl:namespace-alias> |
Date: | Fri, 13 Mar 2009 23:32:15 -0400 |
To: | <bug-XML-LibXSLT [...] rt.cpan.org> |
From: | "Murray, Robin \(IT\)" <Robin.Murray [...] MorganStanley.com> |
* Dist: XML:LibXSLT 1.66-2.6.31 and 1.58
* Perl: This is perl, v5.8.8 built for i686-linux-thread-multi
* O/S: Linux 2.4.21-32.0.1.EL.msdwhugemem
Using test stylesheet:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xslo="http://www.w3.org/1999/XSL/TransformAlias"
version="1.0">
<xsl:namespace-alias stylesheet-prefix="xslo" result-prefix="xsl"/>
<xsl:template match="/">
<xslo:stylesheet version="1.0">
<xslo:template match="/">
Hello! This text was created by an automatically generated
stylesheet.
</xslo:template>
</xslo:stylesheet>
</xsl:template>
</xsl:stylesheet>
Running perl script:
my $xslt = XML::LibXSLT->new();
my $styleSheet = $xslt->parse_stylesheet_file($opt{xsl});
my $xml = $styleSheet->transform_file($opt{xml});
print $styleSheet->output_string($xml);
Output is:
<?xml version="1.0"?>
<xslo:stylesheet xmlns:xslo="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xslo:template match="/">
Hello! This text was created by an automatically generated
stylesheet.
</xslo:template>
</xslo:stylesheet>
According to the spec, the output should have had its namespace replaced
with the 'result-prefix': 'xsl', but in this case it's still 'xslo'.
I've tried various things to make this work but haven't been successful
so far.
Thanks.
Robin Murray
Consultant | Technology
2000 Barrington St | Suite 300 | Floor 04 Halifax, B3J3K1
Phone: +1 902 442-4962
Mobile: +1 902 221-1317
robin.murray@morganstanley.com
--------------------------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.