Altova Mailing List Archives

[xsl] tag case conversion problems again

From: "Snyder, Christopher" <SnyderC@------->
Date: 1/23/2001 11:23:00 AM
Thank you everyone who replied to my previous question.  You've been very
gracious and compassionate to me.  I hope you'll forgive my intrusion yet
again.  The conversion looks like it is working as I desired, except that
attributes are being ommitted rather than lower cased. Once again my goal
with this is to convert an XML doc with upper cased tags (and attributes) to
lower cased tag and attribute combinations.

Any thoughts on what I've done wrong are greatly appreciated.


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl=""

<!-- Transform a document to itself, lowercasing all tag names -->

  <!-- When you match any element -->
  <xsl:template match="*">
    <!-- Create the same element with a lowercase name -->
    <xsl:element name="{translate(name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
      <!-- Including any attributes it has and any child nodes -->

  <!--Match and transform attributes-->
  <xsl:template match="@*">
      <xsl:attribute name="{translate(name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
          <xsl:value-of select="name()"/>

 XSL-List info and archive:


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 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.