case convert, xslt

Case Conversion

1. tag case conversion problems
2. String to LocationPath conversion

1.

tag case conversion problems

Snyder, Christopher

My goal with this is to convert an XML doc with upper cased tags (and attributes) to lower cased tag and attribute combinations.

<?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 select="node()|@*"/>
    </xsl:element>
  </xsl:template>

 
</xsl:stylesheet>

2.

String to LocationPath conversion

Nikolai Grigoriev

I tried to run a stylesheet that inputs a parameter and
interprets the value of it as a location path.
I.e. 
 <xsl:param name="query">no-default</xsl:param>
 ...
 <xsl:template name="querytemp">
  <xsl:apply-templates select="$query"/>
 </xsl:template>
	

This yields "cannot convert to node-set" error

Try

<xsl:apply-templates select="*[name()=$query]"/>.