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: XML tag translation problem


"Snyder, Christopher" wrote:
> 
> Hello everyone.  My apologies in advance for bringing this to the list if in
> fact there is an answer in the archive.  I've searched the xsl-l and xml-l
> archives without finding information enough to sort out what needs done.
> 
> My desired result is, I think, reasonably simple.  I would like to input an
> XML doc with capitalized tags, and have an xsl doc that translates the
> document exactly except for the new xml having lowercased tags, complete
> with lowercased attributes, etc.
> 
> I understand that this involves the use of the identity xsl document.
> 
> The code I'm using looks like this:
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
>   <xsl:template match="*">
>     <xsl:element name="{translate(name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
>                                          'abcdefghijklmnopqrstuvwxyz')}">
>        <xsl:apply-templates select="@*|node()"/>
>     </xsl:element>
>   </xsl:template>
> </xsl:stylesheet>
> 
> What I'm getting is, in ie 5.0 with the 3.0 parser added, nothing.  It
> doesn't give an error message, but no DOM tree is displayed either.  In
> XSLDebugger (www.xsldebugger.com) I get nothing displayed in the result
> window, and the parsed XML doc displays in the preview window as having been
> lowercased, but with the attributes left out.

I don't know about the IE thing, but if you want to copy attributes
across then you have to do it explicitly. The XSL you give above only
creates an element, leaving out any attributes.

-- 
Mike.Moran@ee.ed.ac.uk 
                   Web: http://houseofmoran.com/
               AvantGo: http://houseofmoran.com/Lite/

 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]