xsl-list
[Top] [All Lists]

Re: unnecessary soap elements

2005-10-28 07:15:13
Hi
   I changed apply-templates as you have suggested.
But <xsl:template match="urn:SubmitRequestResponse">
did not work. To make it work, i changed it to
<xsl:template
match="soap:Element/soap:Body/urn:SubmitRequestResponse">.
But i could not understand it wholly. Please explain
if possible.

--- David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:


    <!--
       - Any tag not addressed by a more specific
       - template match is copied unchanged. (This
       - preserves the ph_dispatchmsg tags.)
       -->
      <!-- Here we dump out the rest of the message
tags-->

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

Note that the comments are misleading: XSLT has no
access to the tags in
the source file (don't use tag to mean element, they
mean different
things)

However that does copy all elements, as you say.



You also have
    <xsl:template match="/">
        <xsl:apply-templates/>
    </xsl:template>

(which isn't strictly needed as it's the same as the
default, but that
 starts processing at the top level element, which
is therefore
 copied.

If you want to start processing somewhere else, do
for example

    <xsl:template match="/">
        <xsl:apply-templates
select="soap:Envelope/soap:Body/*"/>
    </xsl:template>
 

  <xsl:template
match="Body/urn:SubmitRequestResponse">

That would match an element SubmitRequestResponse in
namespace
urn:Fiserv.CWS
that was a child of an element Body in no-namespace.
There is no such element in your source, as the only
Body element is in
teh soap namespace. i think you just want

  <xsl:template match="urn:SubmitRequestResponse">


Note you are using a very verbose style which makes
it hard to see what
your code is doing, for example
       <xsl:element name="status">
           <xsl:attribute name="code"><xsl:value-of
select="$code"/></xsl:attribute>
       </xsl:element>

could be written

  <status code="{$code}"/>

and in fact you don't really need the code parameter
either you could
just do
 <status

code="{urn:SubmitRequestResult/fi:fiAPI/fi:Response/fi:Status/fi:StatusCode}"/>

David


________________________________________________________________________
This e-mail has been scanned for all viruses by
Star. The
service is powered by MessageLabs. For more
information on a proactive
anti-virus service working around the clock, around
the globe, visit:
http://www.star.net.uk

________________________________________________________________________


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





                
__________________________________________________________ 
Enjoy this Diwali with Y! India Click here 
http://in.promos.yahoo.com/fabmall/index.html

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