5 Replies Latest reply on Apr 1, 2015 11:56 PM by sivareddy c

    xslt component not adding xsi atrribute to the generated xml output

    sivareddy c Newbie

      i am summarizing my problem in a shorter way where i can directly come to the problem.

       

      I have xslt which will accept soap envelope as an xml and remove the soap envelope and returns the xml which it will be used for further processing .but the generated xml is working fine but it unable to add add attribute to the xml element.

       

      request xml:

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

      xmlns:v1="http://types/resourceinventory/v1"

        xmlns:v11="http://types-unqualified/v1"

        xmlns:v12="http://commonbusinessentities/types-unqualified/v1"

        xmlns:v13="http://core/types-unqualified/v1"

        xmlns:v15="http://resource/types-unqualified-extended/v1" >

        <soapenv:Header>

        <wsse:Security

        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"

        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">

        <wsse:UsernameToken wsu:Id="UsernameToken-E35D486525CC9C0C7B142535531967512">

        <wsse:Username>ABCD</wsse:Username>

        <wsse:Password

        Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">EFGH</wsse:Password>

        </wsse:UsernameToken>

        </wsse:Security>

       

        </soapenv:Header>

        <soapenv:Body>

        <v1:searchAvailable >

        <!--1 or more repetitions: -->

        <v1:resourceSpec xsi:type="v15:REGFHJI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <v11:type>

        <v11:id>id</v11:id>

        <v11:name>TN</v11:name>

        </v11:type>

        <v15:Value>0000000</v15:Value>

        <v15:Subtype>LAT</v15:Subtype>

        <v15:ServiceCategory>GSMP</v15:ServiceCategory>

        </v1:resourceSpec>

        </v1:searchAvailable>

        </soapenv:Body>

      </soapenv:Envelope>

       

      2. this is the line where transformations are happening:

      <to uri="xslt:transformations/soap-enveloper-request-extractor.xsl?contentCache=false"/>

      3. XSLT:

      <xsl:stylesheet version="2.0"

                      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.w3.org/2001/XMLSchema"

                      xmlns:xhtml="http://www.w3.org/1999/xhtml"

                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

                      exclude-result-prefixes="xhtml xsi">

       

       

          <xsl:output method="xml" omit-xml-declaration="yes" indent="no"/>

          <xsl:strip-space elements="*"/>

       

       

          <xsl:template match="/">

              <xsl:copy-of select="soapenv:Envelope/soapenv:Body/*" />

           

          </xsl:template>

        <xsl:template match="/*">

              <xsl:element name="{name()}" namespace="{namespace-uri()}">

                  <xsl:apply-templates select="@*|node()"/>

              </xsl:element>

          </xsl:template>

          <xsl:template match="/*/@xsi:*">

              <xsl:attribute name="other:{local-name()}" namespace="{namespace-uri()}">

                  <xsl:value-of select="."/>

              </xsl:attribute>

          </xsl:template>

          <xsl:template match="@*|node()">

              <xsl:copy>

                  <xsl:apply-templates select="@*|node()"/>

              </xsl:copy>

          </xsl:template>

        

        

      </xsl:stylesheet>

      5: Jboss fuse version jboss-fuse-6.1.0.redhat-379

      Java version 1.7.0_74

       

       

      Can any body suggest what is the problme why the  xslt component unable add xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" add resourceSpec?

       

      Any body have gone through the same issue?

       

      Thanks in advance.