Content wise there is no difference between CDATA sections and the resultant escaped text data. < cannot be in parsed character data so it is converted to < so it is not mixed up with element starting elements. I think when reading from the parser, default parser does not make a difference between the CDATA sections and the normal text sections and the Synapse sees them as just normal text. So the significance of CDATA markers are dropped when it is parsed. Only the serialized form changes but the "content remains exactly the same."
Do you face a problem when not having it in the extact CDATA form? Upul On Thu, Mar 27, 2008 at 8:07 AM, Jeff Davis <[EMAIL PROTECTED]> wrote: > I'm attempting to access a SOAP web service that, unfortunately, uses a > CDATA section within the body of the XML (this wasn't my choosing, :-). > The > abbreviated XML looks like: > > <env:Envelope xmlns:env="http://www.xxx.com/hrit/envelope" > xmlns:hrxml="http://ns.hr-xml.org/2004-08-02" > xmlns:datetime="http://exslt.org/dates-and-times"> > <env:Sender> > <env:id>test</env:id> > </env:Sender> > > <env:Packet> > <env:PacketInfo packetType="data"> > <env:packetId>1</env:packetId> > </env:PacketInfo> > <env:payload><![CDATA[ > <Candidate xmlns="http://ns.hr-xml.org/2004-08-02" > > <test> > <info>this is a test</info> > </test>]]></env:payload> > </env:Packet> > </env:Envelope> > > The issue I encounter is that, when this is sent out by Synapse, it > appears > as (not showing the soap wrapper): > > <env:Envelope xmlns:hrxml="http://ns.hr-xml.org/2004-08-02" > xmlns:datetime=" > http://exslt.org/dates-and-times"> > <env:Sender> > <env:id>test</env:id> > </env:Sender> > > <env:Packet> > <env:PacketInfo packetType="data"> > <env:packetId>1</env:packetId> > </env:PacketInfo> > <env:payload> > <Candidate xmlns="http://ns.hr-xml.org/2004-08-02" > xmlns:oa=" > http://www.openapplications.org/oagis" xmlns:ds=" > http://www.w3.org/2000/09/xmldsig#"> > <test> > <info>this is a test</info> > </test></env:payload> > </env:Packet> > </env:Envelope> > > Notice the CDATA section has disappeared, and the unwanted < appear in > lieu of the < within that. Researching the issue a bit, I discovered this > is > the expected behavior from Saxon (which I believe is the XSTL being used > by > Synapse). I can reproduce this if I just use a blank stylesheet. Now, if I > apply this stylesheet and run it through Saxon manually, it works great: > > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version=" > 2.0" xmlns:env="http://www.xxx.com/hrit/envelope"> > <xsl:output use-character-maps="xml" > cdata-section-elements="env:payload"/> > <xsl:character-map name="xml"> > <xsl:output-character character="<" string="<" /> > <xsl:output-character character=">" string=">" /> > <xsl:output-character character="
" string="
" /> > <xsl:output-character character="/" string="/" /> > <xsl:output-character character="" string="<![CDATA["/> > <xsl:output-character character="" string="]]>"/> > </xsl:character-map> > > <xsl:template match="/'"> > <xsl:copy-of select="*" /> > </xsl:template> > > </xsl:stylesheet> > > Unfortunately, when I plugin this stylesheet into the Synapse <in> route, > it > has no apparent affect (I twiddled with it to make sure it was, in fact, > being used, and it was). > > This is leaving me with a real quandary -- any suggestions? > > jeff >
