xsl-list
[Top] [All Lists]

Re: [xsl] Transform all tags into attributes with some tags omitted

2008-05-16 04:37:11
wonderful! This works! How can I ommit empty tags? They should not be
converted to attributes.

On Fri, May 16, 2008 at 12:32 PM, Michael Ludwig <mlu(_at_)as-guides(_dot_)com> 
wrote:
Michael Ludwig schrieb:

Philipp Kursawe schrieb:

thanks Michael! Is there a way to format the tags to lowercase when
they are attributes?

Yes:

   <xsl:attribute name="{
     translate( name(),
       'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
       'abcdefghijklmnopqrstuvwxyz' ) }">

The above is for XSLT version 1.0. Note that in 2.0, there is a much
bigger and better function library than in 1.0.

http://www.w3.org/TR/xquery-operators/#func-lower-case

If you have to use 1.0, there is EXSLT. If that's not enough, there is
an escape to calling the XSL transform from Perl, PHP, or whatever, and
make the host language functions available to the XSL transform.

Michael

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





-- 
The Dude Abides!

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--