xsl-list
[Top] [All Lists]

RE: [xsl] Rename Some Node ans attribute

2006-10-16 07:24:15
You haven't told us exactly how the transformation fails, but I suspect that 
namespaces are at the root of it.

What namespace(s) is/are the attributes DataOra and idCup in?

Since both of these have no namespace prefix (like "soapenv:" and "ser:"), they 
must be in the default namespace, which you haven't shown us.

Unless that default namespace is declared and named  in your stylesheet and unless the 
attributes are identified in your stylesheet with the declared namespace , these 
attributes will be "invisible" to the the transformation.
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Davide Antoni <davide(_dot_)antoni(_at_)italtbs(_dot_)com>
Sent:     Mon, 16 Oct 2006 15:39:27 +0200
To:       xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject:  [xsl] Rename Some Node ans attribute

Hi to all

I need to change this xml:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:ser="http://services.standardcup.esel.it";>
  <soapenv:Body>
<ser:RICHIESTA_PRESTAZIONI_EROGABILI DataOra="10102005" idCup="1" idOperatore="1"/>
  </soapenv:Body>
</soapenv:Envelope>

into this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:ser="http://regione.campania.it/schemas/cup";>
  <soapenv:Body>
     <ser:ELENCO_PRESTAZIONI DataOra="?" idCUP="?" idOperatore="?">
        <ser:PRESTAZIONE/>
</ser:ELENCO_PRESTAZIONI>
  </soapenv:Body>
</soapenv:Envelope>

Pay attention on idCup that must be idCUP on the trasformation: i have this fot do it:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns="http://services.standardcup.esel.it"; xmlns:cup="http://services.standardcup.esel.it";>
   <xsl:strip-space elements="*"/>
   <xsl:output indent="yes"/>
   <!--
most stuff you want to copy:
-->
   <xsl:template match="*">
<xsl:copy>
           <xsl:copy-of select="@*[name()!='idCup']"/>
           <xsl:if test="@idCup">
                   <xsl:attribute name="idCUP">
                       <xsl:value-of select="@idCup">
                       </xsl:value-of>
                   </xsl:attribute>
           </xsl:if>
           <xsl:apply-templates/>
       </xsl:copy>
   </xsl:template>
</xsl:stylesheet>

Many thanks.

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




--~------------------------------------------------------------------
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>
  • RE: [xsl] Rename Some Node ans attribute, cknell <=