Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Copying without namespace? >Thread Next - Re: Copying without namespace? Re: Copying without namespace?To: NULL Date: 3/10/2008 1:04:00 PM On Mar 5, 3:41 pm, Joseph Kesselman <keshlam-nos...@comcast.net>
wrote:
> Andre-John Mas wrote:
> > The issue is that I end up with an xhtml document that includes
> > namespaces that were only meant to be used in the xsl and not the
> > final document.
>
> Sounds like you're looking for xsl:stylesheet's exclude-result-prefixes
> attribute.
That what I tried doing, currently I have:
exclude-result-prefixes="i18n ota dataList iItemList math"
which excludes non-anonymous namespaces, such as:
xmlns:i18n=""
xmlns:math=""
but how do you exclude an anonymous namespace:
xmlns=""
Reading elsewhere I was given the suggestion of using:
<!-- copies without the template -->
<xsl:template match="*">
<xsl:element name="{name()}" namespace="">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
and changed the original block to:
<xsl:for-each select="$pageMetaData/*">
<xsl:choose>
<xsl:when test="local-name() = 'meta'">
<xsl:apply-templates select="."/>
</xsl:when>
<xsl:otherwise>
<meta content="{.}" name="{local-name()}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
but I am not sure this is the best approach.
Andre
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
