[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

tag case conversion problems again

Subject: tag case conversion problems again
From: "Snyder, Christopher" <SnyderC@xxxxxxx>
Date: Tue, 23 Jan 2001 16:24:08 -0500
conversion problems
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.

Thanks,
Chris

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

<!-- 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',
                                         'abcdefghijklmnopqrstuvwxyz')}">
      <!-- Including any attributes it has and any child nodes -->
      <xsl:apply-templates/>
    </xsl:element>
  </xsl:template>

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

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.