[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: unnecessary soap elements

Subject: Re: unnecessary soap elements
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 28 Oct 2005 14:37:09 +0100
soap body namespace
    <!--
	 - 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
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.