[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 15:35:09 +0100
soap urn
> did not work. To make it work, i changed it to
> <xsl:template
> match="soap:Element/soap:Body/urn:SubmitRequestResponse">.

that would make no difference.

As you posted it, if you made the changes I suggested you would get
<selectreply>
   <status code=""/>
   <selection/>
</selectreply>

with empty code and selection as you have 

<Response TypeOfResponse="ERROR">
<Response TypeOfResponse="DocumentInquiryRs"

ie one Response inside another, but your XPath was

urn:SubmitRequestResult/fi:fiAPI/fi:Response/fi:Status/fi:StatusCode

with just one Response level, change that to

urn:SubmitRequestResult/fi:fiAPI/fi:Response/fi:Response/fi:Status/fi:StatusCode
and you get

<selectreply>
   <status code="0"/>
   <selection>
      <image encoding="BASE64" format="TIFF" view="FBW">
         <data> note that the encoded (front) image data has
been truncated in this sample
0lGODlhiAbgAvcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD//////

VKcuQF1V1p8xnXkxWGcxnGcTyAwx3mcDAMCADsA</data>
      </image>
      <image encoding="BASE64" format="TIFF" view="BBW">
         <data> note that the encoded (back) image data has
been truncated in this sample
R0lGODlhiAbYAvcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD/////
/</data>
      </image>
   </selection>
</selectreply>

David


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:urn="urn:Fiserv.CWS" 
xmlns:fi="http://integration.fiapi.com"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
     exclude-result-prefixes="soap urn fi">

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

    <xsl:param name="appType" select="'IMAGE'"/>
    <xsl:param name="frontview" select="'F'"/>
    <xsl:param name="backview" select="'B'"/>

    <!-- Convert XML to XML -->
    <xsl:template match="/">
        <xsl:apply-templates select="soap:Envelope/soap:Body/*"/>
    </xsl:template>
    <xsl:template
match="urn:SubmitRequestResponse">
        <xsl:element name="selectreply">
	    <xsl:call-template name="status"/>
	    <xsl:element name="selection">
	        <xsl:call-template name="imageTags"/>
	    </xsl:element>
	</xsl:element>
     </xsl:template>

     <!-- Template for building status element -->
     <xsl:template name="status">
         <xsl:param name="code"
select="urn:SubmitRequestResult/fi:fiAPI/fi:Response/fi:Response//fi:Status/fi:StatusCode"/>
	 <xsl:element name="status">
	     <xsl:attribute name="code"><xsl:value-of
select="$code"/></xsl:attribute>
	 </xsl:element>
     </xsl:template>

      <!-- Template for building image element -->
     <xsl:template name="imageTags">
         <xsl:param name="encoding"
select="'BASE64'"/>
	 <xsl:param name="frontView" select="'FBW'"/>
	 <xsl:param name="backView" select="'BBW'"/>
	
         <xsl:for-each
select="urn:SubmitRequestResult/fi:fiAPI/fi:Response/fi:Response/fi:DocumentInquiryRs/fi:Document/fi:Page">
	     <xsl:if test="string-length(fi:Value) > 0 "> 
	         <xsl:element name="image">
		     <xsl:attribute name="encoding"><xsl:value-of
select="$encoding"/></xsl:attribute>
		     <xsl:attribute name="format"><xsl:value-of
select="@Format"/></xsl:attribute>
		     <xsl:if test="@View = $frontview">
		         <xsl:attribute name="view"><xsl:value-of
select="$frontView"/></xsl:attribute>
		     </xsl:if>
		     <xsl:if test="@View = $backview">
		         <xsl:attribute name="view"><xsl:value-of
select="$backView"/></xsl:attribute>
		     </xsl:if>
		     <xsl:element name="data"><xsl:value-of
select="fi:Value"/>
		     </xsl:element>
		 </xsl:element>         
	     </xsl:if> 
	 </xsl:for-each>
     </xsl:template>

    <!--
	 - 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()|@*">
	    <xsl:for-each select=".">
	        <xsl:copy>
		    <xsl:apply-templates select="node()|@*"/>
		</xsl:copy>
	    </xsl:for-each>
	</xsl:template>
</xsl:stylesheet>

________________________________________________________________________
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.