Generate multipart message via XML transformation

Posted by cmspsdn on 28-Jun-2011 21:44

I have created an XML transformation, as below, and it does create the 2 named parts I need. But it has a side effect that it also creates a new message with only the xml version header as the content.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:XQMessageElem="http://www.sonicsw.com/sonicxq/com.sonicsw.xq.service.xform.TransformationElementFactory"
extension-element-prefixes="XQMessageElem">
    <xsl:strip-space elements="*"/>
    <xsl:template match="/">
    <XQMessageElem:XQMessage>
        <XQMessage>
            <part>
   <header>Content-Type=text/xml,Content-ID=Operation</header>
             <content>
                 <operation>
                  <xsl:value-of select="PTManifestSonicStandard/Operation"></xsl:value-of>
                 </operation>
             </content>
            </part>
            <part>
            <header>Content-Type=text/xml,Content-ID=OperationData</header>   
             <content>
           <PTManifestSonicStandard>
               <xsl:apply-templates/>
           </PTManifestSonicStandard>
             </content>
            </part>
            </XQMessage>
    </XQMessageElem:XQMessage>
    </xsl:template>
   
<xsl:template match="PTManifestSonicStandard">
     <xsl:copy-of select="ttPTManifest"></xsl:copy-of>
</xsl:template>
    <xsl:template match="text()"/>
</xsl:stylesheet>

Please excuse the formating, having trouble pasting XSLT.

Message was edited by: GRANT WALMSLEY

All Replies

Posted by sfritz on 28-Jun-2011 23:28

The message you get in addition is the rest of the incoming message.

Set the "Drop default output" runtime parameter of the Transformation service to true.

hth

Stefan

Posted by cmspsdn on 28-Jun-2011 23:54

Thank you Stefan, that was what I was after.

This thread is closed