Mukul Gandhi wrote:
Oops, I used the wrong namespace. The correct template is below..
On 10/16/06, Mukul Gandhi <gandhi(_dot_)mukul(_at_)gmail(_dot_)com> wrote:
<xsl:template match="*[local-name() =
'RICHIESTA_PRESTAZIONI_EROGABILI']">
<ser:ELENCO_PRESTAZIONI
xmlns:ser="http://regione.campania.it/schemas/cup">
<xsl:copy-of select="@*[not(local-name() = 'idCup')]" />
<xsl:attribute name="idCUP"><xsl:value-of
select="@idCup"/></xsl:attribute>
<ser:PRESTAZIONE />
<xsl:apply-templates />
</ser:ELENCO_PRESTAZIONI>
</xsl:template>
Just an opinion, but isn't it much easier to use xpath-default-namespace
and friends to make it more readable? At least you would not have to
deal with local-name() and all those complex constructs (well, 'complex'
is a matter of taste, of course). Also, in the (rare case?) that you
would use the above generalized template with node names that are the
same, but in different namespaces, you would end up matching too much.
Something along the lines (but the default may be placed in the
xsl:stylesheet decl as well):
<xsl:template match="RICHIESTA_PRESTAZIONI_EROGABILI"
xpath-default-namespace="http://services.standardcup.esel.it" >
[...]
And by using copy-of, there's no opportunity to add new templates that
apply to elements lying deeper in the nesting structure. Using
apply-templates gives the possibility to extend this stylesheet with
more overriding idiom. I would vote for the latter ;-)
Cheers,
-- Abel Braaksma
--~------------------------------------------------------------------
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>
--~--