This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Translating element names


> I am having trouble writing an XSLT to do a simple
> transformation task.  I have lots of XML documents
> that have there element tags as CAPITAL letters.  I
> need to write a XSLT to transform these XML documents
> to contain all lowercase elements.

You need something like

<xsl:template match="*">
  <xsl:element name="{translate(name(), 'ABCDEF...', 'abcdef...')}">
   <xsl:copy-of select="@*"/>
   <xsl:apply-templates/>
  </xsl:element>
</xsl:template>

Possibly a bit more complex if using namespaces.

Mike Kay

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]