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

Transforming SOAP with Attachments

Subject: Transforming SOAP with Attachments
From: "Bhaskar, Rajan" <RBhaskar@xxxxxxx>
Date: Thu, 13 Jan 2005 10:12:55 -0500
soap with attachment
Hi,
 I have a SOAP with Attachment which needs to be transformed to a
different SOAP with Attachment. However when SOAP with Attachment is
received it is not a well-form xml. It should basically be separated as
SOAPEnvelope and Attachment content both being well-formed xml.
I want to know if i can use one xsl file taking 2 inputs from
SOAPEnvelope and Attachment as separate source streams and get a single
XML taking some of the values from the Envelope.

Thanks,
Rajan

-----Original Message-----
From: Andrew Welch [mailto:ajwelch@xxxxxxxxxxxxxxx]
Sent: Thursday, January 13, 2005 6:25 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Splitting an +attribute+ string



> I wonder if anybody could quickly profer some advice on this.
> I may well be wrong, but does xsl treat attribute strings
> different to
> normal text nodes when it comes to the "contains()" function.
> I may well
> also be gibbering. I've got my mind into a muddle on this one.
>
> Problem :  To take an attribute in the form of a comma
> delineated string
> (e.g. <gui onShow="apple,pear,banana"
> onHide="black,white,grey"/>) and
> to covert the attributes into javascript array syntax (i.e.
> ['apple','pear','banana'] etc.).
>
> Strategy : "Just" replace the commas with ',' and top and tail the
> output string with [' and ']
>
> Code  :
> <!--To convert onShow-->
> <xsl:call-template name="commaDelineate"><xsl:with-param name="str"
> select="@onShow"/></xsl:call-template>
>
> <xsl:template name="commaDelineate">
>  <xsl:param name="str"/>
>     <xsl:when test="contains($str,',')">
>       <xsl:value-of select="substring-before($str,',')"/>','
>       <xsl:call-template name="commaDelineate">
>         <xsl:with-param name="str"
> select="substring-after($str,',')"/>
>       </xsl:call-template>
>     </xsl:when>
> </xsl:template>
>
> Frustration : The errors seem to be generated around the "when"
> statement. Unfortunately I can't  provide any error output
> because this
> is being done inside a PHP script.

You are missing <xsl:choose> and also:

<xsl:otherwise>
	<xsl:value-of select="$str"/>
</xsl:otherwise>

to get the last part of the string?

Don't kick yourself too hard :)

cheers
andrew

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.