xsl-list
[Top] [All Lists]

Re: [xsl] Getting a sequence of attribute names

2019-07-17 13:15:50
Excellent, Martin, thank you! I was trying local-name(@*), which didn't
work. Thank you for the fast response.

From: Martin Honnen martin(_dot_)honnen(_at_)gmx(_dot_)de
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> 

On 17.07.2019 20:03, Rick Quatro rick(_at_)rickquatro(_dot_)com wrote:

For each of the <em> elements, I am trying to get a space-delimited 
list (or string) of attribute names. For example, the first one would 
be "italic" and the second would be "italic bold". My output would be 
similar to this:

<?xml version="1.0" encoding="UTF-8"?>

<root>

     <p>

         <em class="italic">first paragraph</em>

     </p>

     <p>

         <em class="italic bold">second paragraph</em>

     </p>

</root>



   <xsl:template match="em[@*]">
       <em class="{@*/name()}">
           <xsl:apply-templates/>
       </em>
   </xsl:template>

should do.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>