xsl-list
[Top] [All Lists]

RE: With Saxon7.2, can an aliased namespace prefix be excludedfrom the output?

2002-11-14 12:46:24
Saxon's output when you use xsl:namespace-alias is inelegant but the
stylesheet that it produces is precisely equivalent to the one that you
want.

It will be improved in the next version.

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com 

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Timothy Larson
Sent: 14 November 2002 18:28
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] With Saxon7.2, can an aliased namespace prefix 
be excludedfrom the output?


With Saxon version 7.2, I am trying to apply a stylesheet to 
a stylesheet. Is there any way to exclude the aliased 
namespace prefix from the output?

In the sample below I am trying to get rid of the output line:
  xmlns:x="http://www.w3.org/1999/XSL/Transform"; 

Sample source stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
  xmlns:xsl  = "http://www.w3.org/1999/XSL/Transform";>
</xsl:stylesheet>

Sample stylesheet to apply to the source stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
  xmlns:xsl  = "http://www.w3.org/1999/XSL/Transform";
  xmlns:x    = "http://www.w3.org/1999/XSL/TransformAlias";
  exclude-result-prefixes="x">
  <xsl:namespace-alias stylesheet-prefix="x" result-prefix="xsl"/>
  <xsl:template match="/">
    <xsl:copy>
      <x:stylesheet>
        <x:template m="/"><x:value-of select="test"/></x:template>
      </x:stylesheet>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Output produced:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
  xmlns:x="http://www.w3.org/1999/XSL/Transform"; 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:template m="/"><xsl:value-of 
select="test"/></xsl:template> </xsl:stylesheet>

Output disired:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:template m="/"><xsl:value-of 
select="test"/></xsl:template> </xsl:stylesheet>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>