xsl-list
[Top] [All Lists]

Re: [xsl] template matching priority...

2011-03-28 11:00:39
Fabien,

This isn't what you asked about (the @priority attribute is what you want for that), but you might also consider this modification for the fallback template:

<xsl:template match="row/*">
  <entry><xsl:apply-templates/></entry>
</xsl:template>

This is probably more robust than using a regular expression to match elements by name, plus it better captures the actual logic (elements inside rows should become entries), so it is less likely to have unwanted spill-over effects elsewhere.

Cheers,
Wendell

On 3/28/2011 10:40 AM, Fabien Tillier wrote:
<xsl:template match="*[matches(local-name(),'[N,P]{1}[0-9]+')]">
                <entry><xsl:value-of select="text()"/></entry>
</xsl:template>


--
======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

--~------------------------------------------------------------------
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>
--~--

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