Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Copying without namespace?

From: Andre-John Mas <andrejohn.mas@-----.--->
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





transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent